WordPress.org

Ready to get started?Download WordPress

Codex

Settings Permalinks Screen

Contents

Settings → Permalinks

By default, WordPress uses web URLs which have question marks and lots of numbers in them; however, WordPress offers you the ability to create a custom URL structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links.

A note about performance: Permalink structures beginning with %category%, %tag%, %author%, or %postname%, require more server resources to resolve than structures such as, Day and Name, Month and Name, and %post_id%-%postname%, though as of 3.3 the %postname% structure is usable.

For a more in depth description of the way this structure is specified, see the Using Permalinks article. For an introduction to Permalinks, read the Pretty Permalinks section of Introduction to Blogging.

Back to Administration Screens.

Settings Permalinks Screen


Customize Permalink Structure

A number of tags are available, and here are some examples to get you started.

Common settings 
Check one of the radio buttons corresponding to the correct Permalink Structure for your blog.
  • Default - An example of the default structure is http://www.sample.com/?p=123
  • Day and name - An example of the day and name based structure is http://www.sample.com/2008/03/31/sample-post/
  • Month and name - An example of the month and name based structure is http://www.sample.com/2008/03/sample-post/
  • Numeric - An example of the numeric structure is http://www.sample.com/archives/123
  • Post name - An example of the post name structure is http://www.sample.com/sample-post
  • Custom structure - In the box specify the custom structure you desire to use. One example is /archives/%year%/%monthnum%/%day%/%postname%/. Look at the Using Permalinks article for further discussion of Permalink Structure Tags.
Optional 
You may enter custom bases for your category and tag URLs here. For example, using /topics/ as your category base would make your category links like http://example.org/topics/uncategorized/. If you leave these blank the defaults will be used. Again, see the Using Permalinks article for further discussion of Permalink Structure Tags.
  • Category base - Enter a custom prefix for your category URLs here.
  • Tag base - Enter a custom prefix for your tag URLs here.

Save Changes

Click the Save Changes button to ensure any changes you have made to your Settings are saved to your database. Once you click the button, a confirmation text box will appear at the top of the page telling you your settings have been saved. After you've clicked this button, you should receive one of two messages depending on whether your .htaccess file is writeable. For information on how to make .htaccess writeable, see Changing File Permissions.
  • If .htaccess is writeable, you will get a message that says "Permalink structure updated." You're all set; WordPress has been able to do everything for you automatically.
  • If .htaccess is not writeable, you will see a message at the top of the screen that says "You should update your .htaccess now.". Near the bottom of the screen you will see "If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all." This means you'll have to do one extra step yourself. In the text box at the bottom of the Screen, WordPress displays several lines of rewrite rules associated with the Permalink Structure you designated above. You need to manually copy everything in this text box into your .htaccess file to make your new Permalinks work.


Note: Visiting the Permalinks screen triggers a flush of rewrite rules. There is no need to save just to flush the rewrite rules.
Note: If you're writing your .htaccess file on your own local computer, remember, some operating systems do not allow the creation of a file named ".htaccess" because of the initial dot ("."). You can always name the file without the initial dot or with a standard extension (e.g. "htaccess.txt"). Once the file is uploaded to your weblog's directory, rename it with your FTP software. Most FTP Clients should provide you a way to rename filesthis.
Also Note: Files that begin with a dot (".") like ".htaccess" are hidden on most servers by default. Consult the userguide or FAQ of the FTP software you use to find out how to have the software display these hidden files, and also how to use the software to change file permissions, rename files, etc. For more information on all of this see Changing File Permissions.
Note: Permalink Settings doesn't work, or it shows a blank page :If you get a blank page when you try to access the Permalink Settings page, you need to change the function got_mod_rewrite() in wp-admin/includes/misc.php to the following:
function got_mod_rewrite() {
	//$got_rewrite = apache_mod_loaded('mod_rewrite', true); //old line with false negative;
	$got_rewrite = true;//force the response to true as we know mod_rewite is installed;
	return apply_filters('got_rewrite', $got_rewrite);
}

Changelog

  • 2.3 : Added Tag base setting to Optional.
See also Administration Screens and Network Admin.