0
0
WordpressDebug / FixBeginner · 4 min read

How to Fix Permalink Not Working in WordPress Quickly

To fix permalink not working in WordPress, go to Settings > Permalinks and click Save Changes to refresh rewrite rules. If that doesn't work, check your .htaccess file permissions and content to ensure WordPress can write the correct rules.
🔍

Why This Happens

WordPress uses permalinks to create friendly URLs for your posts and pages. Sometimes, these links stop working because the rewrite rules that WordPress uses to map URLs to content are missing or incorrect. This often happens if the .htaccess file is missing, has wrong permissions, or if the server's rewrite module is disabled.

apache
# Broken .htaccess example
# BEGIN WordPress
# (missing rewrite rules)
# END WordPress
Output
Visiting any post URL shows a 404 Not Found error.
🔧

The Fix

To fix permalinks, first go to your WordPress dashboard, then Settings > Permalinks. Without changing anything, click the Save Changes button. This forces WordPress to update the rewrite rules and write them to the .htaccess file.

If this does not work, manually check your .htaccess file in your WordPress root folder. It should contain the correct rewrite rules and be writable by WordPress.

apache
# Correct .htaccess content for WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Output
Permalinks work correctly; posts and pages load without 404 errors.
🛡️

Prevention

Always ensure your .htaccess file has the right permissions (usually 644) and is writable by WordPress during permalink updates. Avoid manually editing permalink structures unless necessary. Also, confirm that your web server has the rewrite module enabled (like mod_rewrite for Apache). Regularly updating WordPress and plugins helps prevent conflicts that can break permalinks.

⚠️

Related Errors

  • 404 Errors on New Posts: Often fixed by flushing rewrite rules as above.
  • White Screen After Permalink Change: Check for plugin conflicts by disabling plugins.
  • Server 500 Errors: Usually caused by incorrect .htaccess syntax or missing rewrite module.

Key Takeaways

Refresh permalinks by saving settings to update rewrite rules.
Ensure .htaccess file exists with correct WordPress rewrite rules.
Check server rewrite module is enabled for permalinks to work.
Set proper file permissions so WordPress can write .htaccess.
Disable plugins if permalink issues persist after fixes.