SEO

SEO Friendly URL Structure for WordPress Blogs

As some of your have noticed, we changed the URL structure on Search Engine Journal entries today from the classic “/?=4556″ to “/seo-friendly-url-structure-for-wordpress-blogs/4556/” on all Search Engine Journal posts.

I had not done this before because of 4 years of incoming links to SEJ stories which used the old URL structure, and fear of duplicate content issues if redirects did not work correctly. With some help from SEJ co-author (who some of your may recognize from his days at Performancing.com) Ahmed Bilal, we made the switch with little effort.

Step 1 : Go to the ‘Customize Permalink Structure’ page in your WordPress Admin : Dashboard>Options>Permalinks

wp permalink SEO Friendly URL Structure for Wordpress Blogs

Step 2 : Then select the ‘Custom Structure’ Option. We only wanted to list the Post Name and Post ID number in the URL, so we customized it as /%postname%/%post_id%/

A full list of customization options is available at WordPress.org/Using_Permalinks

Step 3 : Don’t save the new Permalink Structure yet! Before updating your Permalink Structure, install and activate the Permalink Redirect WordPress Plugin. This lets you bypass mod_rewrites or changes to your .htaccess file.

Permalink Redirect WordPress Plugin replies a 301 permanent redirect, if requested URL is different from entry’s (or archive’s) permalink. It is used to ensure that there is only one URL associated with each blog entry, therefore eliminating dupicate content issues.

Step 4 : Go back to your ‘Customize Permalink Structure’ page in the WP Admin and hit the ‘Update Permalink Structure’ button.

Now all of the posts on your blog will have the new SEO keyword friendly URL structure and all incoming links which point to the old URL’s will be directed to the new optimized URL’s.

As an added bonus, if you change the Post Slug in your blog posts while Writing new posts or Managing older ones, the URL will reflect the keywords in your Post Slug and not the entire title given to a post. If you notice, I’ve simplified the URL for this post to read “/seo-friendly-url-structure/”.

wp post slug SEO Friendly URL Structure for Wordpress Blogs

Screen Shot 2014 04 15 at 7.21.12 AM SEO Friendly URL Structure for Wordpress Blogs
Loren Baker is the Founder of SEJ, an Advisor at Alpha Brand Media and runs Foundation Digital, a digital marketing strategy & development agency.
Screen Shot 2014 04 15 at 7.21.12 AM SEO Friendly URL Structure for Wordpress Blogs

You Might Also Like

Comments are closed.

72 thoughts on “SEO Friendly URL Structure for WordPress Blogs

  1. I have a question.

    I want to change the permalink structure in one of my blogs from:

    /archives/%year%/%monthnum%/%day%/%postname%/

    to

    /%post_id%/%postname%/

    Is it possible to get it done in a search engine friendly way?

  2. As long as the redirect plugin is working correctly, this should be no problem.

    If anything, the /archives/%year%/%monthnum%/%day%/ may be harming you as some engines, like Yahoo, give higher ranking to pages closer to the root directory.

    So, according to the newer URL structure, you’ll only be one or two steps from the root, in the old structure, you were 5 steps away.

  3. Just to be safe go and do a site:searchenginejournal.com query (or look at Webmaster Console) and scan through the results so you can see if Google might be picking up on other duplicate pages. I have a issue with my poll plug-in on my sidebar that was causing enormous duplicate content issues. I have blocked the spiders from the URLs and ripped the poll down and currently looking for alternatives.

    The problem is Google was essentially thinking the poll URLs were the ones to show in the SERPs, blah.

    You can read more about it here:

    Duplicate Content Issues, Any Help?
    http://www.webproworld.com/viewtopic.php?t=72549

  4. Jann – it sounds like you did the right thing using robots.txt to block the extra URL’s generated by your poll. In a month or so you should see the supplemental results decrease.

  5. Glad to see you have made an update.

    There are plugins to optimize post slugs automatically if you don’t want to do it manually

    The URL structure has nothing to do with how content is organised in archives, there are other ways to manipulate your content such that even your oldest content is ranked as well as your most current.

  6. Well, I’ve been using “/?p=” for the last 6 months. I surely want to change over to the “/postname/post_id/” format.

    But, I’m afraid if I would lose a lot of visitors since my article was changed to another URL. Is there someway to go through this process without losing any blog readers or having marked as duplicate content ?

  7. Hi, i have read your post and try the step according to your post. However, it seems that my old permalink won’t redirect to my new URL.
    My old url used: /%year%/%monthnum%/%day%/%postname%/

    and i change it to /%postname%/%postid%/

    However, i have submitted some article to some forum or website and my old permalink won’t redirect to the new permalink. Any suggestion or should i change it back? Because google has indexed my old permalink page.

  8. Your posts after making this change have not been available from the My Yahoo rss feed. It appears that this change has broken that feed.

  9. i have a problem in blogs there is so many poups and extra openning urls so can any one please guide me.
    Is it possible to get it done in a search engine friendly way?

  10. I am curious, as Cvos said, why bother with the post_id? If someone could tell us the pros/cons, it would be much appreciated.

  11. Loren,

    Inspired very much by this plugin, I changed my links SEO friendly to /%postname%/ .

    The link structure advised even by Matt Cutts is http://example.com/blog/sample-post and mine has become exactly like that, thanks Loren and Bilal

    I am on Yahoo hosting. As said by Ken above, the damage was that, it broke all RSS links and my RSS feed content now is a big blank.

    Could you please do a tweak as I would like to retain the link structure as well retain RSS feeds? Contact me anytime for cooperation.

  12. @Drew

    The answer to “why bother with the post_id?” is that if you leave the post_id out of your permalink-url you can possibly end up with 1 identical urls for 2 diffenrent posts – given these posts have the same title.

    So it’s saver to include the post_id in your permalink-url.

  13. I have looking at other people’s blogs and wondered, “How’d they do that?” Thanks for the well written and illustrated post. I have updated my blogs to use the method and plugins you provided.

  14. @ xteb looks like you have a good url structure to me. If I was searching for “wordpress seo strategies” and saw your Heading URL shown as posted I would click on that. does the .html make that much of a difference?

  15. The .html used to make a huge difference, but now it only makes a minor one.

    WordPress 2.3 added canonical URL support, ensuring there aren’t any URL splits (where some backlinks have a trailing / and some don’t).

    If you have already changed your permalink, and are running WordPress 2.3, don’t bother… it really, really isn’t worth it. If you are just now tweaking your permalink, go ahead and add the .html for good measure.

  16. It is always good to change dynamic urls to static ones. I can feel your worries but if things are done right, the old url will be directed to the new one without any duplication issue.

  17. I did what was instructed and got a message that I should update my htaccess file. Also, when I try to go to the pages I get page not found. Any advice?

  18. Hi there, and thanks for a great post.
    I do get a problem when I do this to my blog.
    If you want to look at it, its http://www.planetscrap.com

    What ever option I use of the permalinks, it will not load any pages. But if I use the standard, it shows all pages.

    When I switch it even gives the old filename for the about page. I edited the about page to Articles. When I have the std setup, it goes to the articles. But when I add the new permalink structure, it goes to about. That dont exist. And the same with all the other pages I have created.

    Can anyone tell me what to do here?

    Leif-Harald

  19. Okay, just tried this method on a WordPress site and it seems to work fine. The only thing that makes me nervous is having the redirects dependent on one little plugin. Thanks for sharing this, Loren.

    SEO Videos, I am using the 2.3.2 version of WordPress and it didn’t take care of it without the plugin.

  20. Hi Loren,
    I wrote 400 posts in wordpress before realising the benefit of seo friendly urls. I now want to use them from this point on.
    But as I still get many google hits from the old 400 posts, I don’t want to lose them. How can I get round this problem?
    Thank you

  21. I have several blogs, one of which has been #1 in the search results for years, and I have wanted to do this for a long time.

    I don’t know which version of WordPress existed when you wrote this article and SEO Videos wrote “Nice post there, I think that the latest version of wp already takes care of all this.”

    Does version 2.5.1 do this and if not, are your instructions compatible with version 2.5.1?

  22. The slug 301 capabilities don’t seem to work in wordpress 2.6 for permalink redirect. That potential of a plugin no longer accomplishing an instruction in newer versions makes me hesitant to modify the existing urls.

  23. Your blog is very informative. However, it is pretty hard task but your
    post and experienced serve and teach me how to handle and make it more
    simple and manageable.

    Thanks for the tips… Best regards.

  24. Actually, you should consider doing your URL’s like this :

    /%category%/%postname%/

    google likes to see site structure, and it helps give weight to the more important, top level pages. with all your posts looking like top level pages, its hard to determine a site structure.

    Note: if you get 404 or ‘page not found’ errors after making your changes, you need to update your .htaccess file.

    Note II: If you already have 400 pages, use a plugin to 301 (perm redirect) the the new URL’s.

  25. Having a “structure” may help, depending on your SEO goals. Remember, the residual link juice will trickle down, but there are diminishing returns.

    Matt Cutt’s blog has very little structure. The majority of his site exists at /blog/ (which tops the root domain). All articles are simply /blog/%postname%.

    Of course, he did not attach an article ID, but again, that’s okay for his blog. The structure depends on your SEO goals.

  26. hi It is always good to change dynamic urls to static ones. I can feel your worries but if things are done right, the old url will be directed to the new one without any duplication issue.

  27. I have the same question as Sheridan above, can you comment on what, if any, impact changing the url structure had on incoming traffic from old posts (assuming the redirect is done correctly)?

  28. I have this permalink structure: /article/%postname%/. what do you think? I’m implementing yours now but what do you feel about that permalink structure?

  29. I installed the plugin and then changed the permalink structure to /%postname%/%post_id%/ and now when you click o n one of the new blog posts with the new url structure it redirects you back to the homepage? How do I correct this as the permalink redirect plugin does not seem to be working.

  30. Thanks for the article.
    I m using this /%year%/%monthnum%/%day%/%postname%/

    With above the url of category pages changed to
    sitename.com/category/article/ .

    How can I make it sitename.com/article?

    thanks for help

  31. I have been using “/%category%/%postname%” for my custom URLs in wordpress. I do not like seeing ugly numbers in my urls. cleaner the better but always organized.

  32. Thanks a lot for the detailed instructions, I was worried about changing it and almost did with the redirect plugin. Glad I cam across this or I would have had some duplicated articles, thanks agin.

  33. I have one wordpress blog with multiple authors (50+), so having a unique id number in the URL is crucial for me but I also wanted the benifit of SEO keywords in the URL and also retain some website siloing (aka category structure)

    I came up with this
    /%category%/%postname%-%post_id%

    Notive the -postID rather than /postID
    This stops it looking like 4556 is a page under “seo friendly url structure”
    searchenginejournal.com/seo-friendly-url-structure/4556

    Instead I would get this
    searchenginejournal.com/wordpress/seo-friendly-url-structure-4556

  34. Hey Loren, please answer this for me as i am a bit confused right now. The permalinks structure that you gave right now is /%postname%/%postid% as this is what you are using on this fantastic blog. And also it comes close to description to the guidelines given by google if you want it to be indexed by Google news. However i have just came across an article on permalinks which says,

    “For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields. The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to distinguish your Post URLs from Page URLs (which always use the text “page slug” as the URL), and to compensate, WordPress stores a lot of extra information in its database (so much that sites with lots of Pages have experienced difficulties).”

    http://www.labnol.org/internet/wordpress-permalinks-structure/12633/

    So now i am feeling a little confused as to which url shall i use right now? Please throw some light on this as it would mean a lot to me. Thanks.

  35. thanks for the tips, i am just planning to launch a new blog for my website and this would help me to get seo friendly urls for my new blog. thank a lot

  36. I want my permalinks to have *html extension and i have try this but cant work:
    /%postname%/%post_id%.html

    what can I do ?