WordPress Code Snippets

A fresh mix of code snippets and tutorials

Why aren’t permalinks working?

16

Here is a quick guide for troubleshooting why WordPress permalinks might not be working.

In WordPress, permalinks are the “pretty” URLs that look like “http://example.com/2012/post-title/” or “http://example.com/category/wordpress/”. By default, WordPress creates dynamic URLs that look like “http://example.com/index.php?p=77”. To enable the pretty permalinks for your site, do the following:

  1. Log in to the WP Admin
  2. Go to Settings > Permalinks and select the type of permalinks you would like to use
  3. Click “Save Changes” to activate permalinks

At that point, WordPress will try to add the required htaccess rules for permalinks, but may not be able to do so depending on your server settings. These htaccess rules must be in place for permalinks to work. Thus, if permalinks aren’t working, check to see if WordPress was able to update your htaccess file, which is generally located in the root directory of your site.

If the htaccess rules are in place and permalinks are still not working, check to see if your server has mod_rewrite enabled:

  • Paste <?php phpinfo(); ?> into a blank PHP file called “info.php” and upload to your server.
  • Open the file in a browser (via http://example.com/info.php)
  • This file will generate a PHP info file that summarizes the details of your PHP installation.
  • Scroll down to the Apache header and check to see if the mod_rewrite module is listed.

If you do have mod_rewrite enabled and permalinks still aren’t working, there could be an issue with a plugin, third-party script, or other htaccess rules.

Learn more

WordPress Themes In Depth


Show Support

Like our new Facebook Page to show support!