BuddyDev

Remove /blog slug from the default blog of WordPress Multisite subdirectory installation

Remove /blog slug plugin for wpmu allows you to remove /blog slug from the sub directory install of your wordpress mu or wordpress 3.0 multisite.

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.
here is my plugin Remove /blog Slug

Now this will be the official home for this plugin and I will be providing updates and support via this post/buddydev forum only.

Download

Click here to download Remove '/blog' slug plugin for wordpress Mu v1.1

Version 1.1 is tested with WordPress  Multisite 3.9.

Installation

1. Download the plugin Remove '/blog' slug plugin for wordpress Mu 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.6, 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.

Let me know how it went with you. Any suggestions/improvements ?
Thanks
Brajesh

49 Responses to Remove /blog slug from the default blog of WordPress Multisite subdirectory installation

  • Hi Brijesh,
    Is there any way to change the blog slug to something else maybe news or dictionary

    • hi Mridul
      Yes, you can. Enable this plugin and then prefix "/news/" or what ever the new slug you want in the custom permalink,category base and tag base.

      This plugin will strip the blog slug but leave others. So you get your own custom slug working in that case.

      Hope it helps.

  • Thanks for that. It's hard to imagine why they didn't make this an option in the WPMU admin section. Most of my WordPress projects are not blogs and I've seen an array of similar WordPress use cases. Whatever the case, your plugin works perfectly and it's especially nice to be able to change the "blog" slug as noted.

    • hi David
      Thanks for the comment.
      Guess what, I too don't know, why they did not make it so 😀
      Anyway, wp is our beloved CMs and with a few quirks, we love it wholeheartedly 🙂

  • Hello! Just to let you know that I'm testing it with WPMU 2.9.2 and it's working perfectly. Thanks!

  • Left a comment on the old blog post but got the hint, you only provide support over here. So here's my questin:

    Hi Brajesh,

    i stumbled upon your plugin while i was working on a client project with upcoming wordpress 3.0. I suppose you are aware of WordPress MU being merged to WordPress in this very version. And the nasty “blog”-slug-problem came along with this.

    But WordPress 3 handles the www-routine different, forcing the user to access via the full http://www.domain.com. So your plugin isn’t working for this new wordpress.

    Do you see any chance in reacting on this? I’d absolute love to remove the blog-slug, as it doesn’t make a lot of sense in my scenario. I’m using the new custom post types for content, that’s definitly not a blog-post.

    I hope you’ll reply on this. Thanks for your great work.

    • hi
      Thanks for the comment.
      Ahh, I need to mention that on ThinkingInWordpress.com, anyway, I am planning to revive that site again soon 🙂

      I will be testing it on one of my server today and will post update by Sunday evening if required.

      Thanks
      Brajesh

      • Thanks for your Reply. Any results on your testing the day before yesterday?

        Thank you

        • Tested on 3.0, It works. You will need to change permalink and resave.
          btw, I have tested in multisite mode not in single site mode.
          Thanks
          brajesh

  • I too am interested in the WP3.0 functionality.

    • It works on wp 3.0 rc2.
      You will need to activate the plugin, change permalink and save and then save back your original permalink. Change of permalink is required for allowing the plugins to save it. Just resave back original after changing.

  • Ora #

    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

  • I tried it out with WP 3.0.1 and the permalinks page is still showing /blog/. Nothing seems to work. I have refreshed the permalink structure as you instructed…. Just giving you a potential heads up.

    • Hi Ethan,
      Thanks for the comment. I had tested it with wp 3.0 but not with wp 3.0.1, Will test today and post back.

      Thanks
      Brajesh

  • Bob #

    Hi there Brajesh and thank you for this plugin, will be trying it out shortly.

    For the life of me I cannot understand why WP have not given an option to remove /blog as it makes no sense at all for those who want to develop their own network.

    much appreciated

    • Thanks for the comment Bob. Looking forward to your test.
      I guess, the convention is to organize the content a little better way but they should have given a choice 🙂

      • Bob #

        Hi Brajesh, I have added the plugin and it has worked well so far, once I test a little further I shall provide further feedback

        much appreciated

  • Hi Brajesh,

    I left a note at your other site. I cannot get this plugin to install since the latest update of WP. (3.0.1)

    It keeps returning a not found error when I try to activate it or deactivate it.

    Any help would be so much appreciated!

    • Hi Tina,
      Thanks for the comment. It seems to me your permalink structure has not changed after you activated this plugin.
      To make it work, Please change the permalink structure and save(we need to flush out the rules). After that you can change back to the original permalinks and This should work.
      Please let me know if you have already followed it.

      • Hi Brajesh,

        I tried your suggestion. I had it set on custom permalinks and I changed it back to the default permalinks and tried to activate the plugin. Instead of returning a not found, it just redirects to the front of the website.

        It installed perfectly on WPMU (WPMS) 3.0 but since 3.0.1 it just hasn't worked. I've tried it on a local installation and on a live installation.

        I hope that helps. Thank you so much for your reply.

        • Not to worry – I worked out what the problem was.

          For some reason on my local installation – it installs in plugins/cc-remove-blog-slug.

          When I tried it on my live installation it kept telling the that the file could not be found so I moved the file straight into the /plugins folder and it works perfectly.

          Thank you so much!

  • Thanks!It works for me!!!i have wp 3.0.1.

  • Do you have any other advice for getting this plugin to work? Using WP 3.01 in a subfolder installation. When I use this plugin, it does remove the /blog/ portion and seems to work (permalinks show up correctly in the nav links and on the Edit pages), but all of the links route back to the root site home page only. The only permalinks I can use that actually route to the pages are the default ugly options, which are not good at all.

    I've activated/deactivated the plugin, and regenerated the permalinks about a dozen times, but nothing. Any suggestions?

    Thanks.

    • It seems you have not updated the permalink structure.

      To make it work, you will need to flush the rewrite rules. An easy way to accomplish that will be:-
      1. Copy your current permalink structure and save it for later use
      2. Change permalink to something else and click save, The rewrite rules will be flushed.
      3. Change back to your original permalink, click save and you are done.
      All the pages should work now.

      Hope that helps.

      Thanks
      Brajesh

  • I have the same problem, and can't wait to try this solution. Thanks so much for all the help.

  • I installed v1.1 of the plugin using the downloaded .zip and the admin panel plugin installer. I then went to Settings >> Permalink, saved a modified permalink (/%postname%.htm) and then saved with the original permalink (/%category%/%postname%.htm). So far it has not worked. I'm still seeing URLs like:

    site.com/blog/categoryname – wordpress category archive
    site.com/blog/tagname – wordpress tag archive
    site.com/blog/categoryname/postname.htm – wordpress post

    instead of

    site.com/categoryname – wordpress category archive
    site.com/tagname – wordpress tag archive
    site.com/categoryname/postname.htm – wordpress post

    I'm running WP 3.2.1 single site installed in the blog subdirectory of the main site. And, I'm also using the FV Top Level Categories plugin to get rid of the /category/, /tag/, /archive/ before the actual names in the URLs.

    Any suggestions would be much appreciated…I really need to fix this.

    Thanks.

    • Hi,
      this plugin is not for single site. It is for multisite as multisite creates virtual /blog in the permalink.

      Since you have installed your singlesite wordpress in /blog directory, I don't see a way to remove /blog from the url.

      Hope that helps you to understand the issue.
      Regards
      Brajesh

  • Hi Brajesh –

    That makes sense. I've added "define('WP_ALLOW_MULTISITE', true);" to my wpconfig.php. This causes Network Setup to appear in Tools in the admin panel. I've gone ahead and deactivated all plugins as required for the install process. And, I've looked through http://codex.wordpress.org/Create_A_Network.

    But, I have not yet clicked "Install" in Tools >> Network Setup as I'm not entirely confident I understand what will happen. What I'm hoping is this will simply keep my existing blog as is and enable the possibility of adding more blogs. And, it will allow the plugin to suppress the "/blog/" in the permalinks. And, as far as I can tell, after clicking install I'll need to

    – create /wp-content/blogs.dir
    – edit wp-config.php following directions provided by install
    – edit .htaccess following directions provided by install
    – log out of admin panel and log back in
    – update users to grant site privileges

    Is that basically correct? Does anything happen to the existing blog during this process?

    Thanks.

  • GREAT PLUGIN.I love it

  • Brajesh,
    Thanks for the plugin. It is not working for wordpress 3.5 :(. Can you please check?

    • Hi Sarafraz,
      Thank you for the comment. Just checked it with WordPress 3.5 multisite. It is working fine.

      Please make sure to activate this plugin(Network activate) and then change your permalink(just to flush the rewrite rules, after that you can change back to your old permalink) and the plugin will work.

      Hope that helps.
      Regards
      Brajesh

      • Jon #

        Tried this on 3.5.1 and it does not work. I network activated the plugin and then changed the permalinks to default, but the problem persisted.

        • Hi Jon,
          Just tested it with WordPress Multisite 3.5.1
          The plugin is working fine. Please make sure that you have followed the installation instruction to flush the permalink.

          Please do let me know if you still have issue.
          Thanks
          Brajesh

  • Hi Brajesh, thanks for the plugin, which I installed on WordPress 3.51 it works for the pages , but now the categories aren't working, I can access them if I add the blog slug back in though but was hoping to get rid of it completely, tags still work though, have you got any idea how I can fix that ?

    • Hi Gary,
      Thank you for the comment. Please check if some category base is specified in the permalinks settings.

  • Oh, it has worked! No "blog". Great plugin. Thank so much!

  • I have over a hundred user driven sub sites running on my WordPress Multisite Network. I tested updating manually on a few of them, and it works just fine. But, how do I update the permalinks of each of them?

    Thanks in advance.

    PS- Why don't you upload this plugin to the WordPress.org repository?

    • Also, do newly formed sites need to update their permalink structures? This is messy.

      If the above mentioned problems cannot be solved, I would like to know a way to revert the plugin's doings. I tried deactivating the plugin but the sites for which I didn't update the permalinks still take me to their homepage.

      (I hope I made some sense, there. :))

    • Hi Abhimanyu,
      Thank you for the comment.

      1. You only need to update the permalink for your main site and not for any sub blog. It will work.
      2. If you deactivated it(as in another comment), Please make sure to update your permalink again(You can always revert back to the old permalink, it just needs refreshing).
      About uploading it to wp.org, I just forgot it at that time(It is too old plugin which I had originally released on my other blog). Now, as you have nudged me, I am going to put a request on wp.org for the same 🙂

      • I get a 404 error on the subsites that I haven't updated the permalinks for.. (while I have reactivated the plugin and refreshed main sites permalinks.)

        UPDATED
        http://spadelhi.org/aneeshnandi/portfolio/a-multi-storey-office-in-barakhamba/

        NOT UPDATED
        http://spadelhi.org/ashish/portfolio/site-planning/
        (This link gives a 404 – redirects to homepage)

        • Hi Abhimanyu,
          It seems portfolio is custom post type. And that is causing the problem. Check for normal posts/pages they will work without any issue.

          When you use a custom post type, the permalink must be refreshed. It seems the theme/plugin creating the post type is not refreshing it, that's why you have to do it manually.

        • The problem is, when I deactivate the plugin, the sites that I have updated the permalinks for already, still don't have /blog/ in their permalinks, even if I update their permalinks now.

          i.e some blogs are left with 404 while others are okay (plugin deactivated)

          its vice-versa when plugin is activated..

          This plugin is becoming a curse for me. :/

          Any help?

        • Sorry Abhimanyu,
          I could not help much as I got caught in some personal issues. I hope that you got some solution.

        • Nope. I didn't. Can you still help me reverse the plugin's doings?