in Permalink, Search, Tips and Tricks, WordPress

Playing with worpdress permalink

Today I will show how to play with wordpress permalink. If you are just working with a fresh wordpress installation then certainly you need to do some work with wordpress permalink structure. Just check in admin left menu Settings->Permalinks
Here is first look of your default permalink structure. Check your post and page url is like:

wpdefaultpermalink
Post: http://sitename.com/?p=N, where N = post id
Page: http://sitename.com/?page_id=N, where N = page id
Category: http://sitename.com/?cat=N , where N = category id
Tag: http://sitename.com/?tag=TAG SLUG, pls check bellow what is slug
Author:http://sitename.com/?author=N, where N = author id


Now, let’s change the permalink structure to any custom format… here I am choosing the Month and name format and see screenshot bellow
wpcustompermalink
Oh, check another thing before and after changing permalink structure,if you are in edit more of any post or page, check bellow the subject box
For default permalink: there is a option “Change permalinks”
For custom permalink: there is a option “Edit”
Check the screenshot bellow:

wpcustompermalink2

Please check here what we are editing or getting automatic after saving first time(or auto save) the post … is called slug for that article, we use article name alias for joomla same way. if seo enabled in joomla then that alias is used. Ok ,now check after changing permalink to any custom format what happened to all permalinks like posts, page, author, category, tags etc. Let’s check
Post and Page will get as the screenshot above (example http://localhost/blog/2010/01/playing-with-wordpress-permalinkslug-quick-seo/)

Category: http://localhost/blog/category/category slug/
Tag: http://localhost/blog/tag/tag slug/
Author: http://localhost/blog/author/author username(nick name) is here/

Check here for category,tag, author etc the bold part we are telling base like catgory base, tag base or author base. and the italic part is slug, Sometimes that base is also called slug for simplicity.

Making post link .html
If think you cheked some wordpress site has post link as .html … more like static and more friend for google .. I mean search engines. No worry, it’s just easy. Put a .html in the custom permalink format of your post.
Just write this in custom field
/%year%/%monthnum%/%postname%.html
and my current blog post url is now
http://localhost/blog/2010/01/playing-with-wordpress-permalinkslug-quick-seo.html
Making the url more short
I think now our url got too long and sometimes that is bad for serach engines. So while we write blog post we can keep the title long(not more than 160 may be… 160 length is good for search engines) but we will edit post or page slug as short as possible. That the trick … taking specially care as do for your girl friend or your baby.
Oh another way we can make the url short… let’s change the permalink again. Let change custom permalink as
/%postname%.html
and my post link is more short now
http://localhost/blog/playing-with-wordpress-permalinkslug-quick-seo.html
for news site we can use like this

/newid%post_id%/%postname%.html
now link is like
http://localhost/blog/newid160/playing-with-wordpress-permalinkslug-quick-seo.html

So I think we played too much with post permalink and now we know how to change the post permalink as we need. Isn’t it easy ?

Chaning page link to .html
There is no easy way to change page link .html like post from wordpress but we can do it via a plugin, acutally wordpress has that support to change permalink for page or others … so plugin authors can hack easily. To change page link like .html you can use this pluginCustom Page Extensions

Working with Category,Tag and Author base
Let’s play with category and tag base that is available in wp permalink.

categorytagbase
So now tag link be like
http://localhost/blog/postbytag/tag slug
Category link
http://localhost/blog/topics/category slug

Hei we are not finished yet. How about removing category base from category permalink ?
let me explain if you don’t change category base that means default is “category” then
http://sitename.com/category/category slug
and for child cateogory
http://sitename.com/category/parent category slug/child category slug

and now what I want to do is like bellow

http://sitename.com/category slug
http://sitename.com/child category slug

Yes we can do that I mean remove category base using plugin. I like to use No category parents. I have tested in a client’s site and it’s working fine.

Yap we can change author slig(base actually) too ,,, not remove, just change default author base “author” to any custom word like “blogger”, “contributors” etc.

Old: http://www.sitename.com/author/manchupagla/
New: http://www.sitename.com/contributors/manchupagla/

For this so many wordpress plugins are available. But I like to use Author Slug, in codex check here. You can search codex for such plugins.

Heh heh talked too much today. I will recommend you to use another two plugins

Note: Check this post in bengali in amaderprojukti forum from here.

thank you for having patience to read this blog. Don’t forget to click share in social network and I like donation(check right col donation box :D)

  1. i use both post ID and postname in the permalink. can i now change it into only postname? And after changing the permalink should i do anything else like 301 redirection?

    • After you change permalink all posts links will be changed and will lost from google/search engine index. I meant it will cause article url change overall and wordpress will not make auto redirection from old url to new url but will use the new url straightforward.

      thank you

  2. I just change my permalink to %postname%.html but google is giving crawl error for all my post as

    %postname%.html/feed 404 error and trackback too stop working

    how this can be fix

    • @Pradip %postname%.html/feed should not be feed url for wordpress. If you change permalink to .html it will only cause the posts. For pages you can use any custom plugin Normally wordpress feed url is yoursite.com?feed=1 or if permalink is enabled then yoursite.com/feed or if you use any plugin to create custom feed url. BTW, after changing permalink it’s better to resubmit the sitemap via google webmaster , this will help to stop for crawl error.

      thank you

  3. Hi

    Do you have any solution to insert .html extension on the category url.

  4. Thanks for the seo tips. I want to make post in Bangla language on my wp blog. Can you tell me how can I do this?

Comments are closed.