Remove /blog slug from the default blog of wpmu subdirectory installation

Jotted by brajesh on September 23, 2009

Do you want to remove the ‘/blog’ slug from post url for the default wpmu blog .
In the sub directory style install of wpmu, ‘/blog’ is added to the permalink structure,category base and tag base for default blog(or main blog).
Removing it is quiet easy. If you don’t wish your posts to have url like http://yoursite.com/blog/somepost-goes-here and want it to look like say http://yoursite.com/somepost-goes-here,I have an easy solution for you.
Download my plugin Remove /blog slug plugin for wpmu , It is has only 10 lines of code.

How to use it.
1. Download the plugin wpmu remove blog slug if you have yet not downloaded it.
2. Install it as any other plugin.You may upload to wp-content/plugins or just use plugin installer to upload and install it.
3. Go to Dashboard->Plugins(Installed plugins)
4. Activate “Remove /blog slug plugin for wpmu”

5. Go to Settings->Permalink
6. Copy your current permalink and then change something in permalink, save it. Now put your old permalink and save again. (See,  you have to save it twice, we are just forcing wordpress to update the permalink structure by changing it, if you don’t change, the permalink is not saved, so It will not work. To get over it, we change it to something else, then save and then revert back to the original structure)

7. Go and check your posts now,they will have no “/blog/” slug anymore.
I have tested it with wordpress Mu 2.8.4a, wp 3.0 multisite but I hope it should work fine with other versions too. I even tested it on a buddypress+wpmu installation and it just works fine.

I will love to hear back your feedback. Please let me know your suggestions/views and anything you want here .
Have a great day!
Brajesh

[blinklist] [Bloglines] [del.icio.us] [Digg] [dzone] [Facebook] [Ma.gnolia] [Mister Wong] [Reddit] [Sphere] [Sphinn] [StumbleUpon] [Technorati] [Email]
If you enjoyed this post, make sure you subscribe to my RSS feed!
Grab my other free plugins here at wordpress Plugins repository.
We will keep coming with more informative tips,tricks,tutorials to keep you updated with wordpress/buddypress/wordpress mu regularly.If you want to help us,You can ,by spreading the words.We provide free and premium plugins/support for wordpress Mu,buddypress at a very low cost (starting with $30 for 3 months membership).If you or anyone you know,needs some real good plugins/themes for their wordpress Mu/buddypress powered site, Please refer them to http://BuddyDev.com.We will highly appreciate your support and keep coming with more useful and free stuffs.


20 Responses to “Remove /blog slug from the default blog of wpmu subdirectory installation”

  1. edunol says:

    hello thanks for this plugin.
    as you mention above, i tried so many times & blog/ slug successfully hide but, i am unable to open any pages.. , category.. , post.. When i click any url then by default showing only home page(index.php).

  2. brajesh says:

    hi
    As I see on your main site,permalink is not enabled (as the posts are having p=id syntax).
    Please enable permalink,or point me to your site.
    I have tested it and it is working.
    you can see an example here
    http://fused.in

    Please point me to the site after enabling this plugin and saving permalink,may be I can help.

    Thanks
    Brajesh

  3. edunol says:

    sorry i have deactivated.. please check again..

    • brajesh says:

      hi
      I see the problem now.
      Well,It has perhaps something to do with the www thing.By default wpmu does not allows www and I am not sure,whether you have edited the db or what to make it with www.
      As far as fusedin was concerned,It has an un updated beta version,I just updated the plugin there and now you can see all the urls are without /blog and are working.

      Please let me know ,what you have done to get www in the url,may be I can think of some solution.

      Thanks
      Brajesh

  4. Ronal says:

    thanks you saved my day!

  5. Jane says:

    I have a question tangential to the topic of your post. I’d like to delete a blog post – and I know that’s a bad idea. What if I just changed the content and changed the title, and changed the slugs? I have a plugin that transfers the old slugs to the new slugs.

    What are your thoughts about that?

  6. brajesh says:

    hey Ronald ,you are most welcome :)
    @Jane
    Thanks for visiting.well,an SEO expert can answer your question better.still my advise is,do not delete the old post.Just make a permanent redirect from the old to the new one.That should save the rakings

  7. Xevo says:

    Thanks Brajesh, plugin worked a charm.

  8. [...] more here: Remove /blog slug from the default blog of wpmu subdirectory installation | Thinking In WordPress:-D… Comments0 Leave a Reply Click here to cancel [...]

  9. koms says:

    Thanks for the plugin. It works for me.
    How to get www in the url?

    • brajesh says:

      hi komas
      do not use www with wpmu. It can cause a lot of trouble in future as wpmu does not support this www thing at present and tends to get erroneous if you use them.

  10. koms says:

    Brajesh,

    Thanks for the reply.

    WPMU does not support www in the urls. That means, doesn’t it redirect www urls to no-www urls?

    Whenever i try to use url with www, its pointing to home page with no-www.

    for ex:
    if i try http://www.example.com/page1, its getting redirected to example.com

  11. Jane says:

    Brajish,

    I followed your advice. I’m a plugin user, but started using an .htaccess file for all my redirects, which has real advantages: I can change the redirects again and again, if I change the slugs (see above) again and again. I can easily change the order of the redirects and keep them in post order (followed by pages) so it’s easy for me to find the ones I’m looking for (especially when Google Webmaster Tools shows me that there’s been a “no follow” on one). So changing the content and the slugs is no longer any problem at all.

    Thanks.

    Thanks.

  12. [...] Download and activate this plugin. [...]

  13. [...] Download and activate this plugin. [...]

  14. Ora says:

    this is not working for WordPress 3.0 – getting these errors. Do you know what could be causing this?

    Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘cc_remove_blog_from_tags_categories’ was given in /home/eju/public_html/wp-includes/plugin.php on line 166

    Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘cc_remove_blog_from_tags_categories’ was given in /home/eju/public_html/wp-includes/plugin.php on line 166

  15. WOW… I have been looking for this for the longest… Many Thanks


Leave a Reply


Get Adobe Flash playerPlugin by wpburn.com wordpress themes