We often get asked how to set up certain WordPress settings here at Themify. We thought it would be a good idea to provide some tutorials on how to get started with some of WordPress' features outside of themes. Here is an in-depth tutorial on how to set your WordPress permalinks. To note: A permalink is a link or URL that points to a specific post or page entry.
WordPress Default URLs
The default structure of a permalink uses the post ID as a unique identifier in the url: http://example.com/?p=23
If you're happy with this then you're good to go. But it you're like most people and you want to spice things up a bit more, keep reading on.
Customizing your URLs
To change the default structure to something thats a bit more friendlier and more readable, go to Settings > Permalinks. There you should see a screen that looks something like the image below. In this example we've already chosen to use a "Custom Structure" for our links but you can choose one of the other defaults available if you want.
Available Permalink Tags
If you've chosen to use a "Custom Structure" then there are some useful tags available to you:
- %year% = the year of the post (eg. 2010)
- %monthnum% = month of the year (eg. 08)
- %day% = day of the month (eg. 25)
- %hour% = hour of the day (eg. 16)
- %minute% = minute of the hour (eg. 29)
- %second% = second of the minute (eg. 12)
- %postname% = post slug (post title)
- %post_id% = the ID of the post
- %category% = category slug of where the post is stored
- %author% = author name
You can use these tags listed to customize your permalink like we have in the image example above. Make sure to end your custom URL structure with either %post_id%
or %postname%
so WordPress has a unique identifier to point to. Here are some good examples of common, custom, permalink structures:
- /%category%/%postname% =
yoursite.com/category/post-title
- /%post_id%/%postname% =
yoursite.com/23/post-title
- /%year%/%postname% =
yoursite.com/2010/post-title
Adding to your URLs
You can also add a string, including file extensions, to the end of the url as seen in the examples below:
- /%category%/%postname%/ =
yoursite.com/category/post-title/
(forward slash added) - /%category%/%postname%.html =
yoursite.com/category/post-title.html
- /%category%/%postname%.php =
yoursite.com/category/post-title.php
You can, technically, add anything to the end of the URL and WordPress will interpret it properly. This is useful if you are migrating from a static html site and you want to keep the old URL structure.
Categories & Tags
By default WordPress uses "category
" and "tag
" as the base name for the category and tag archives respectively. You can rename these under the permalink settings as well. A good example of why you might change these base names would be if your blog was all about cars. It would look a lot nicer if you changed the category base name to "car" and the tag base to "model". This way your category URL structure will look something like yoursite.com/car/category-slug
and the tag URL structure would be yoursite.com/model/tag-slug
. Here's what those settings would look like:
.htaccess File
What happens when you've set this all up but its not working? In most cases, you are probably missing the .htaccess
file in the root of your WordPress install. Open up your FTP client, connect to your server and make sure that there's a .htaccess
file and that it contains the following code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Reference: for more information about WordPress permalinks, visit WordPress codex.
Zaid Pirwani
March 10, 2011 @ 7:37 pm
Hi, nice summary of the reference at WordPress Codex….
But, I think you should have also mentioned the Best Practice, in terms of PRETTY LINKS.
“For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields. ……… So, it is best to have at least two path segments in your post’s permalink structure such as /%year%/%postname%/ or even /posts/%postname%/ ……. (Some people recommend /%post_id%/%postname%/ which works for performance reasons but….”
Reference: http://codex.wordpress.org/Using_Permalinks
(I intentionally left the But their)
I think if small site, go with only /%postname%/ otherwise use /%post_id%/%postname%/
http://pulsapaketinternet.blogspot.com/
February 9, 2015 @ 6:26 am
Handy info. Thanks.
Keep tutorials like that up! You guys rock!
Zaid Pirwani
March 10, 2011 @ 7:38 pm
BTW /%post_id%/%postname%/ provides a good short-url or sorts, you can use the same url without the name part and only the post-id.
I just wanted to clarify that I am not too bright, so help me “Other People Who Know Better”.
Nick Plekhanov
March 10, 2011 @ 8:47 pm
Handy info. Thanks.
Keep tutorials like that up! You guys rock!
العاب
May 18, 2012 @ 2:45 pm
I changed my permalinks to
/%category%/%postname%.html
it works fine
thanks
Baraja Blog
November 8, 2012 @ 10:02 am
Thank you!
Really nice post.. It’s Work in my blog with /%postname%.html permalinks.
I’d like to improve my knowledge in wordpress
Nipun kumar
January 17, 2013 @ 5:21 am
Hi guys,
I am facing a problem with custom permalink as i am using wordpress for article section of my site and when i am using custom structure /%category%/%postname%.html but it didn’t work for me .
I am using this structure because i have some urls those are without .html extension and i want to open those urls with html extension.
thanks in advance for any help.
sabrian
January 30, 2013 @ 5:55 am
just one query if i change from default to custom .. will it make impact on existing url?
Mike Bernard
March 8, 2013 @ 7:16 pm
Hi,
I have just migrated my 60 page website from a flash based site to wordpress.
This post has been helpful to convert my urls from one site to the other.
Thankyou :-)
biloggirl
June 28, 2013 @ 5:49 am
Hi I have a problem may url permalink is missing.
Right after I published a post, the built in permalink created as:
permalink: /my-first-post/
I am expecting Permalink: http://www.margebuot/my-first-post/
Please help me.
Yury
September 21, 2013 @ 4:42 pm
is it possible to get following permalink strukture:
/%postname%/ – for pages
AND
/blog/%postname%/ for blog-pages?
regards
shakil
December 27, 2013 @ 10:32 am
nice tutorial. i think %category%/%postname% would be better. it’s more readable and meaningful url
Belajar SEO
February 5, 2014 @ 9:41 am
This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more … good luck
regards
belajar seo
Jeffrey Wattles
February 7, 2014 @ 11:56 pm
I couldn’t understand the Word Press doc on this topic, but your better explanation enabled this newbie to solve the problem I was having by myself–which makes me feel proud. Nice work, indeed!
jasa toko online
May 18, 2014 @ 5:05 pm
Initially very confusing how to alter the permalink become seo friendly, but it is very easy
thank you for your tutorial
Regards
Chord Lagu
August 25, 2014 @ 7:44 am
according to SEO experts, permalink setting is great for SEO boost, but I am still confused about the best permalink settings. whether use published date or directly such as post title.
Nick La
August 25, 2014 @ 6:20 pm
Post title would be more URL/SEO friendly.
Gaush Alam
November 25, 2014 @ 4:19 pm
Great Post ! What should be best permalink for WordPress blog ?
Nick @ Themify
November 28, 2014 @ 12:05 am
It depends on what you need. The category and post title seems to be the most commonly used because it tells the subject and title.
2016 Volvo XC90
February 1, 2015 @ 3:25 am
Wow . . . Good Information for me and other sir . . . I will read other tutorial Thanks Sir :D
modifikasi motor injeksi
February 13, 2015 @ 12:16 pm
Spot on with this write-up, I seriously think this web site needs much more attention. I’ll probably be back again to read through more, thanks for the information!
Rumah Ayu
March 7, 2015 @ 9:52 am
Thank you for another essential article. Where else could anyone get that kind of information in such a complete way of writing? I have a presentation incoming week, and I am on the lookout for such information.
Noman
March 31, 2015 @ 9:45 pm
I think we should use Customize our permalinks because it’s makes our wordpress url clean and seo friendly.thanks for your useful post :)
Rina Gonjreng
May 28, 2015 @ 4:32 am
hey, i saw your post about permalink is very useful to increase my visitor UX. if i use the right type of permalink, it will makes my visitor easily remember the title of my post. tks for sharing.
Gez Cooper
May 28, 2015 @ 4:13 pm
hi i a events page which displays all our company events. I wish the events to be displayed in date order. how do I do that and what code do I need to put where?
Please help its driving my mad.
Kurt Uy
May 29, 2015 @ 4:14 pm
Hi,
You can change the order of your event based on the date by following this tutorial link. It outlines if you would like to do query your events or what you need to add if you would like to display it as a shortcode. If you need any further clarification with this, please do not hesitate to email us at info[at]themify.me
Kebaya Modern
February 22, 2016 @ 6:36 am
Handy info. Thanks.
Keep tutorials like that up! You guys rock!
Jonathan Gonzales
February 22, 2016 @ 7:49 am
the most simple step to setting permalink I found in here… thanks for sharing sir :)
Chad Nilsson
March 24, 2016 @ 4:00 pm
Is there any way to alter the url for only specific pages? The client I’m rebuilding the site for has requested that I change the url’s for some of the pages to keep their existing SEO authority, but some end in .php and others are just normal. All the solutions I’ve found change the extension for EVERY page URL and I just need to add .php to certain pages. Any thoughts?
Nick @ Themify
April 7, 2016 @ 6:23 pm
You can add .html at the end of the permalink, but not .php (eg. /%category%/%postname%.html)
resep kue kering
April 3, 2016 @ 5:42 am
I changed my permalinks to
/%category%/%postname%.html
it works fine
thanks
Apkmod
September 21, 2016 @ 9:47 am
I am using this structure because i have some urls those are without .html extension and i want to open those urls with html extension.
thanks in advance for any help.
Lagu gratis
February 13, 2017 @ 3:43 pm
Hello,
How to include the sub category base in the URL, I mean
Website,com/category/subcategory/post
Please help me out. Please make a video tut.
Indra
March 26, 2017 @ 9:58 am
It’s work, thanks!
Sarah
September 7, 2017 @ 3:27 pm
Permalinks is one of the first things I fixed when I started using WordPress. Its great to read the reason why and the impact it has if you don’t. Thanks great article.
Teh dian
August 1, 2019 @ 8:23 am
All of feature on themify, is it in accordance with SEO 2019??
Cecilia @ Themify
August 1, 2019 @ 6:04 pm
Yes, all Themify products are SEO ready. If you’d like to take it a step further, we usually suggest the Yoast SEO plugin: https://wordpress.org/plugins/wordpress-seo/
chordabcd
January 22, 2023 @ 10:06 am
Thanks for the guide, the problem has been resolved.