↑ Return to P30 Plugins for URL

PRIV P31b Permalinks, Postname,Slug, URL


Page no: P31b

Permalink, URL, Slug

Permalink: Is the full URL of a post or page in your blog including the name of your blog.

WordPress generates the URL based on the settings above. The Postname is the final part of the URL.

Slug: Is only the URL part that follows after your blog name.

via corecommerce.com:

For example in the URL http://www.mystore.com/shop the [category] slug is Sony-Ericsson and in the URL http://www.mystore.com/sony-ericsson/sony-ericsson-w715.html

Wrong Permalink structure

Yoast and Matt Cutts: Permalinks, Task-Away

 

The take-away of the following discussion from Joost de Valk and Matt Cutts is the following:

 

Yoast does not discuss point 4, for more details on stop words here.

Via Yoast

Posts and Postnames in WordPress DB

Both posts and pages are stored in the WordPress DB with four important attributes:

  1. Postname: the final part of the URL.
  2. PostID : A number that uniquely identifies the post/page.
  3. PostType (post, page, etc.)
  4. PostTitle: is the piece of text that titles the post/page

For a full description of the DB structure see Rachel McCollin‘s post.

By the default mechanism above, WordPress fills the post title into the Postname when the blogger writes a new post. But he can override the Postname inside the URL of the post/page.

URL Settings

What is the best URL settings? (see screen)

According to best SEO sources it is a custom structure called “/%category%/%postname%/

Wrong Permalink structure

- Click to enlarge

URL Redirect Logic

URL Change

What happens in Core WP, when the Post URL changes

WordPress has built-in functionality, which monitor the revisions of the post and if it find a revision do a 301 redirect to the published version of the post. This whole process is in init (startup) of WordPress and it is fully automatically.

DB Tables

What are the DB tables involved?

 

It is using wp_posts table and the rows which are with post_type = revision.

Page URL

What happens when Page URL changes?

 

New row in wp_posts is added on URL change.
This is done for both posts and pages

Broken Link

Link to internal post: Will the link be broken after change URL?

 

 

No, WordPress will handle the url without problems. There is no any built-in functionality for redirecting pages.

(in Confluence: No, they use technical ID, but display URL)

Tag URL

Link to tag archive: Will the link be broken after change tag URL?

 

 

 If there is no any other redirect plugins – yes, it will.
Can we do same as Confluence, link to technical ID, but display URL?

Confluence is password protected, but we are not. They don’t care about SEO, but we do. So we can’t use technical ID. We need proper internal linkbuilding.

What about both technical ID and readable URL?
When the URL changes (e.g. for pages) we use the technical URL.
Google sees the readable URL. As said above, also Google News needs it.

WordPress SEO URL / Permalinks considerations

Let’s answer some of the questions that continually pop up: what does the optimal WordPress SEO URL / Permalink structure look like? How should you use your URL’s, what should and shouldn’t you do with them. A lot of questions below, a lot of answers, most with a reference to a video or post from Matt Cutts, the head of Google’s web spam team.

The perfect WordPress SEO URL structure

I’ll be honest. I think it’s dead simple and that you basically have two options. The URL should end with the post name and could possibly be prefixed with the category. No other options really make sense.

This means you’d end up with a permalink structure as follows:

1 /%postname%/

or, with the category:

1 /%category%/%postname%/

Yoast and Matt Cutts: How to Build Permalinks, the Take-Away

 

The take-away of the following discussion from Joost de Valk and Matt Cutts is the following:

 

Yoast does not discuss point 4, for more details on stop words here.

Via Yoast

Putting the date in the URL has very few benefits, if any. I’m not a fan because it “dates” your older results, possibly getting a lower click through over time. The reason the postname has to be in there is probably obvious, but still: it would mean you get another mention of the main keyword in your URL. This is also why my WordPress SEO plugin’s Page Analysis feature checks for this (example below). WordPress SEO URL check

Permalink Structure

Should I use the category in my permalink structure?

If your domain name is short and your category names are short and descriptive, there can be a pretty big benefit in having the category in the URL. You should take care though; if your slug (the part of the URL that identifies the post) is long and you have the category in the URL as well, that might potentially lead to a very long URL which is harder to share and won’t benefit you as much in Google.

If you decide to use the category in the permalink, make sure to pick short and descriptive slugs for your categories, and to preferably pick only one category for each post. You might take some info from this video from Matt Cutts as well:

Should I add .html to my permalink structure?

I don’t believe for one moment that this would help you, even though this seems to be a long standing myth, neither would .php or other extensions. But… some people feel otherwise. Watch the video below, where Matt says that it has no effect on core ranking in the end but it “might” on other things, which leads some people to think it’s beneficial:

I’ve emailed Matt to see if I can get some more info out of him. Some other extensions though, might in fact hurt you, Matt has warned in the past about not using .exe in your URL’s, for instance.

Update:

I emailed Matt and asked whether it makes sense to add .html for systems like WordPress. His response:

In general I wouldn’t. My WP has urls like http://www.mattcutts.com/blog/remove-result/ and that’s pretty ideal.

So. Case closed.

URL’s

My blog is in Google News, don’t I need numbers in the URL?

In the past, Google News required you to have a unique number in the URL to be indexed. This is still true unless you have a Google News XML Sitemap, as you can see in the Google docs. The Google News module for my WordPress SEO plugin provides you with such an XML sitemap and there are a couple of other plugins that can do that for you, so you no longer need those numbers in there.

 

Should my focus keyword always be the first keyword in the URL?

It might help a tiny bit, but getting it in there is way more important than having it in the first few. Matt did a video on this too:

Slug

How many words should I use in my slug?

 

For a perfect WordPress SEO URL, your slug should be no longer than 3 to 5 words. From this interview with Matt Cutts:

If you can make your title four- or five-words long – and it is pretty natural. If you have got a three, four or five words in your URL, that can be perfectly normal. As it gets a little longer, then it starts to look a little worse. Now, our algorithms typically will just weight those words less and just not give you as much credit.

URL Change for SEO

Should you change your URL structure for better SEO?

After saying that this is the best approach for your SEO, you might expect me to say that you should even change your URL structure for this benefit. While I might change it if it’s an “old style” URL structure like ?p= (and thus are not having the SEO benefits of the keyword in your URLs), if you’re currently using the date in the URL, changing it is not always a good idea. It really depends on how long you’ve been blogging under that URL structure and how competitive the market you’re in is. In quite a few cases, I’d do a lot of other things first before changing the Permalink structure, even when you’re not sporting the perfect WordPress SEO URL settings.

If you’re on Apache and you decide to do the redirect, having been on a/yyyy/mm/dd/%postname%/ structure before, you might benefit from this simple redirect which you could throw into your .htaccess file:

1 RedirectMatch 301 /d{4}/d{2}/d{2}/(.*) http://example.com/$1
Performance issues with this WordPress SEO URL structure

 

 As the codex states, there are some performance issues with this permalink structure. Performance would be better when the URL structure contained the post ID, or started with a static thing such as /posts/%postname%/. To be honest, I couldn’t care less. If you’re not willing to invest in WordPress hosting a bit, you might as well not optimize for search. Next to that, the detrimental performance effect of a perfect WordPress SEO url setting is mostly gone when you install a proper caching plugin.
Conclusion: the perfect WordPress SEO URL

 

 It really depends on your site what the perfect WordPress SEO URL looks like, but they don’t differ often. It helps if you make these considerations up front, but you can always make them later too, just be sure to do proper redirects from your old to your new structure.

Post author: Joost de Valk

Joost de Valk is the owner and creator of Yoast.com. He’s a WordPress / Web developer, SEO & and an Open Source fanatic. He’s also (and more importantly) the father of three sons called Tycho, Ravi and Borre, a daughter called Wende and the husband of the lovely Marieke, who also works at Yoast. Read all about Joost »

Comments

By DimitrisI wish you made this post a year ago, before i choose my stupid permalink :p

 

Dimitris
By Dainius

Joost,
in some cases, eg. if you publishing for very long time, lets say 5+ years and you are frequent publisher (more 20 posts a day), date variations of permlink structure makes sense. But it is very specific case. As you told %postname% or %category%/%postname% (recent is listed as a little faster and less server resources consuming) is logical in 99%+ cases.

Reply By Damon

I’ve found that %postname% and %category%/%postname% to be very buggy when using lots of taxonomies with titles similar to post titles. If you have an ingredients taxonomy for a recipe blog, /ingredients/lamb/ will break a post that begins with “lamb” or “ingredients.”

I usually go with either %post_id%-%postname% or %year%%monthnum%-%postname% depending on whether the posts are time-sensitive or not when I plan on using a bunch of taxonomies.

Also, the Panda Update made maintaining these taxonomies as viable search landing pages a lot more labor intensive.

Dainius

Damon

By Waheed Akhtar

Great tips Joost. Have been following most of the points on my blog.

Just a quick question: If my post title is “10 Great Tips for Designers to Improve WordPress SEO”
and I edit/make the URL/Permalink like “www.myblog.com/tips-improve-wordpress-seo” …. does this really help?

Thanks for this great article.

 Waheed Akhtar
By [keyword removed]

I have the date + title permalink structure.. I think its better to stay with it.. cant risk changing it .. anyways I am not on the worst kind 😛

thanks a lot for this awesome post !

[keyword removed]
By Caspar Aremi

Hi Joost,
how do we get the Google News module? One of my sites is in Google News and I’d love to have access to this!
Thanks
Caspar

Caspar Aremi
By Dan Johnson

Thanks Joost.

You mentioned using only a single category if you include the category in your URL. We use multiple categories (if applicable), and then use the Hikari Category Permalinks plugin to choose which category goes in the URL. Any thoughts on this method? Maybe you could review the plugin.

Reply By Joost de ValkSounds cool, will check it out 🙂

Dan Johnson

Joost de Valk

By Sean

The only thing that makes me hesitant to change my permalinks structure is the social data tied to them such as Facebook “Likes” (which I believe Google and Bing are using for ranking purposes now). Any insight on this?

After setting up the 301 redirects is there any way to “transfer” those FB Likes from the old URL to the new one?

Reply By Joost de Valk

That’s a valid concern Sean, though I suspect Google and Bing will handle the redirects properly, the counts in Facebook like buttons and Twitter buttons will probably go bust.

Reply By Sean

Thanks, I suppose I will hold off on changing it for now as I’d prefer to keep the Facebook Likes/social counts. I’ll definitely be using this permalink structure on my future websites though!

Reply By Jenny

I have switched previously and you are 100% correct. Using Shareaholic, all of my Like and Tweet counts went to 0.

Reply By Dave WardI recently changed my URLs from /yyyy/mm/dd/slug/ to /slug/ and my social sharing counters reset to 0 for the new URLs, as you’d expect. I worked around that by manually recreating the old URL and feeding that to the widgets for posts that were originally published under the old URL scheme.

I wrote a post about it, going into more detail and showing the code I used in my theme: http://encosia.com/preserving-social-sharing-counters-through-a-url-change/

Sean

Joost de Valk

Sean

Jenny

Dave Ward

By Lyena Solomon

For me, as a user, it often helps to see the date in the URL so I know how dated the information is. Of course, when an article is updated, the URL does not change. Dateless URL also looks cleaner. Thank you for such informative post.

Lyena Solomon
By Dana

Thanks for the detailed post. I’m really interested in the part about the “detrimental performance effect of a perfect WordPress SEO url” and how using a proper caching plugin can reduce / eliminate that. I wrote an article a few months back about how permalink structures can affect site performance so I’m asked about that topic quite regularly.

I tend to agree with your idea that a caching plugin can negate any performance hit, but I haven’t had a chance to test that out myself. I was wondering if you’ve done any performance testing on your site with the current permalink structure AND a caching plugin? Or maybe you know someone else who has? My gut feeling says you’re right, and I’d be VERY VERY happy to have a solid, alternative permalink performance problem instead of just beginning with a number…

Reply By Joost de ValkDana, it all depends on how the caching works of course, but knowing how W3TC enhanced page cache works, for instance, that’s faster because it doesn’t actually have to resolve the page in WordPress once it’s cached.

Reply By Dana

Joost, thanks for the clarification about using W3 Total Cache. That’s the caching plugin I’m most familiar with, and knowing W3TC is also what you meant gives me much more confidence in using “clean” permalinks without worrying about the performance (as long as W3TC is active). If I get a chance I may test this out with a few different caching plugins out

of curiosity. I’ll be sure to pass on the results if I do.

Thanks again!

Dana

Joost de Valk

Dana

By Aff

If you have a category named for example “WordPress”, is it in any way possible to make the url’s look like this:
for category: domain.com/wordpress
for posts: domain.com/wordpress/post-title

I’ve tried it several times and always getting errors.

 Aff
By Dave

Your posts always have some diamond tips. Thanks again. 🙂

Dave
By Frank

We run a fairly heavy site (6 million unique / 30+million pageviews month) and found the performance hit was significant enough that we changed to a date / post ID format and saw an immediate decrease. The URLs 301d automatically and as a result it has not impacted our SEO at all (been 6+ months now).

While we do invest greatly in our servers, we also reduce performance bottlenecks were possible.

That being said, another consideration regarding permalink and unicode character sets and their impact on compatibility.

Example: http://mydomain.com/???/ is encoded as:http://mydomain.com/%E9%84%AD%E6%97%A5%E5%AE%87/

This ends up breaking a lot of thing from both plugins as well as 3rd parties.

Facebook, for example, has acknowledged this is an issue for anyone using the Like Button, etc. on their websites with unicode URLs:

http://bugs.developers.facebook.net/show_bug.cgi?id=14701

.. but closed the issue citing “I’m afraid this is an issue we won’t be able to fix. The URL standard doesn’t like unicode characters in paths.”

 Frank
By Jenny

I recently changed from the ?p= URLs to a /id/postname/ structure and I’m having a heck of a time dealing with the redirects. I did write up a blog post about how to change the right way otherwise your blog pretty much won’t exist anymore. If you’re interested, check it out if you’d like: Changed My Permalinks. Find a problem? Do You Want Pretty Permalinks Too?

Overall I recommend the switch but just be prepared for months and months of manual redirects (I use the Redirection plugin).

 Jenny
By Alex AguilarI prefer simplicity in all things and use the domain.com/%category%/%postname% structure in my site and it works like a charm. I notice your own url structure is even simpler – just yoast.com/%postname%. I find the idea of a minimalist, simple, uncluttered url to go with a minimalist, uncluttered WordPress theme very appealing for some reason. Alex Aguilar
By Yves Baggi

Yoast,

I’d love to get your word on this:
https://developers.google.com/speed/pagespeed/

I went back to /%post_id%/%postname%/
for my blogs with over 50 pages (based on
forum discussion and other bloggers
mentionning it)

Because of the rewrite rules it is
great to have a unique number right
after the domain name. I could mesure
an increase in load time on one site
with 648 posts and pages but no diff
wiht blogs with less than 100.

What’s your take on this? any experience?

Yves

 Yves Baggi
By johnit is a great site and i personally learned a lot from this site i am very thank ful to the site owner great efforts john
By Jackstin

Very Informative post! Glad to get some type of confirmation on this topic. We’ve built 100+ WP sites and always use category/postname and Google loves our clients sites.

We don’t suggest creating a ton of pages (probably less then 100) with this link structure it will slow down a site when you get to have hundreds of pages. So performance will become an issues unless, like Joost said you get drop a Simple caching tool like W3 total Cache or WP Super Cache and then your golden for this.

Use posts to organize the data when possible. Limit your sites when is comes to page creation. A good information architect will harness the power of TAGS and POSTS when it comes to delivering a large site!

Thanks for clearing this up. Another thing is to0 be careful when naming a Page and Category the same perma slug. From my experience WP will serve the Category Archive over the Page and can be confusing when developing your page templates. If you run into this case. Simply write the template to the Category Archive Template and not page.

Cheers,
jackstin

Jackstin
By jp

This has really been a great discussion about SEO friendly URLs or permalinks. Thanks

jp
By JMS

This is a related question… If my friendly URL name is different from the menu name of an item, will that affect SEO? So, if my URL was “small-business-seo-tips” but my title and menu name was “Search Engine Advice for Your Business”, would the search engines ding me? THanks!

JMS
By Xav

Nice post Joost.

I’d be interested to hear your thoughts on the performance factor of your chosen permalink structure though. I saw this vid (http://bit.ly/ikYf2M) from WordCamp Melbourne a while ago where Dion Hulse urges people not to use /%postname%/ on it’s own, citing performance issues. Is this only likely to matter to larger scale WordPress sites?

Thanks
Xav

P.S – Ignore the title of the video and try to get past the generally slow start. It is predominantly focused on permalink structure and how it affects site performance.

Xav

Trackbacks

  1. […] WordPress SEO URL / permalinks considerations by Yoast Filed Under: WordPress Tips Tagged With: best permalink structure, best wordpress permalink, wordpress permalink, wordpress permalink structure, wordpress permalinks […]

Tags: , , ,

See more for P3x Plugins for URL