No results found. Try again with different words?

Search must be at least 3 characters.

How to Refresh / Flush WordPress Permalinks?

Sidebar Image

Did not find a solution? We are here to help you succeed.

Whenever a new Custom Post is added through a plugin or code; usually WordPress permalinks need to be flushed.

  • Step 1: In the WordPress admin area, go to “Settings > Permalinks
  • Step 2: Click “Save Changes
  • Step 3: Permalinks and rewrite rules are flushed.
Permalink Settings Recording

By saving the permalink settings, WordPress regenerates the necessary rewrite rules and flushes the existing permalink cache. This ensures that any changes or updates you have made to your permalinks structure are applied correctly.

It’s important to note that refreshing or flushing permalinks might temporarily affect the accessibility of your site’s pages. However, this issue should resolve automatically once the permalinks are regenerated.

How to do this with WP CLI command?

To refresh or flush WordPress permalinks using the WP-CLI command-line tool, follow these steps:

Step 1: Open a command-line interface (CLI) or terminal.

Step 2: Navigate to the root directory of your WordPress installation using the 'cd‘ command. For example:

cd /path/to/your/wordpress/installation

Remember to replace “/path/to/your/wordpress/installation” with the actual path to your WordPress installation directory.

Step 3: Run the following WP-CLI command to flush the permalinks:

wp rewrite flush

Step 4: Press Enter to execute the command.

The wp rewrite flush command regenerates the rewrite rules for your WordPress site, which includes refreshing the permalinks.

After running the command, you should see a success message indicating that the rewrite rules have been flushed.

Please note that using the wp rewrite flush command can affect the accessibility of your site’s pages temporarily, similar to saving permalink changes in the WordPress admin area. However, the issue should resolve automatically once the permalinks are regenerated.

Was this article helpful?
Sidebar Image

Did not find a solution? We are here to help you succeed.

Related Docs

Join 1,653,898+ Happy Site Owners Using Astra

Whether you are a beginner, small business owner, or professional web developer, Astra provides all the tools you need to easily build your beautiful WordPress website.

Download is Just A Click Away!

Membership Retention Checklist Download

REWIND

YEAR IN REVIEW

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form
Scroll to Top
Now choose your preferred
page builder addon
Choose your preferred page builder addon

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form