Code Tutorial
How to Flush WordPress Permalinks Using WP-CLI
If you're facing issues with WordPress permalinks, you can easily flush and refresh permalinks using the WordPress admin. However, if you are a developer you can use the WP-CLI:
wp rewrite flush
If you are new to the WP-CLI, follow these steps to get flush your permalinks:
- Step 1: Install the WP-CLI.
-
Step 2: Change to the root directory of your WordPress site
cd /path/to/your/wordpress
. -
Step 3: Run this command
wp rewrite flush
.
Your WordPress permalinks are now refreshed, and the rewrite rules are updated.