Can I simply delete blog slug?


Is there any reason why one couldn't just delete the slug "blog" in the db wp_options > permalink_structure (multisite install)? Is there a reason why that is a bad idea? Because I've seen this plugin
granted, it's not a lot of code, but, ...again, just looking to understand if there's a reason not to delete.

Big thanks!

  • jennybeaumont
    • Design Lord, Child of Thor

    Hey Phil,

    Hmmm... I was kind of hoping for a better answer :stuck_out_tongue:

    Do I *really* know what I'm doing? Well, yes and no.

    I know that I can plainly see in the db where the blog slug is defined. I see pretty plainly that I can delete it from the permalink structure (whereas this is not available on the admin side).

    What I don't know is if, for example, during a future upgrade of Wordpress, this slug might then get inadvertently added back in, or if it will effect the way subsequent blogs are created. Or if the sky will fall down or something, you know, bad stuff.

    Again, 20 lines of code to strip the slug out of the URL seems unnecessary if I can just delete :slight_smile:

    thanks again!

  • Jonathan
    • The Incredible Code Injector


    I've played around, with various methods, and one way or another the /blog/ slug comes back. The best temporary solution is the plugin you listed. I say temporary as all you need to do is change the permalink structure and the /blog/ slug appears again. Then you've got use the plugin again. Or worse, have some other plugin flush the rewrite rules, or have a user update his/her permalinks (happens all the time) - and you got 404 errors all over the place.

    [ranting] I *hate* the /blog/ slug, and think it is the most simple minded / near sighted implementation that wordpress has done - they could have at least given us an option or a work-a-round that is permanent. [/rant over] - laugh

    But, until they change it or give us the option to change it - we are never a 100% sure that it won't reappear and send our pages into 404 hell :slight_frown:

    But, if you want to delete the /blog/ - phil is correct, leave the database alone...
    You will find it under network admin -> sites -> / -> edit -> settings
    scroll down the page till you get Permalink Structure and delete the sucker :wink:
    And then some time later, watch it show up again :slight_frown:

    I'm sure its hardcoded somewhere to check and fix itself - this is to stop a few special folks from creating a page/post/category etc conflict. Meaning a new site yourdomain/site1 and a page called site1 :wink:

    Oh, the above hack doesn't work with buddypress installed, and is considered a glitch (will be fixed I'm sure soon).

    Oh, and please, if you find a permanent way - I'm all ears, and would be over the moon - seriously :wink:


  • DavidM
    • DEV MAN’s Mascot

    I've used that plugin myself on a number of sites to great effect. The thing is, you really have to be cautious about your use of slugs and pay special attention to how plugins are using slugs.

    If you come across a permalink conflict, having used that plugin presents another point you'll always have to consider.

    As an example of this consideration, if you have a site named 'about' and also a page on your main site named 'about', no doubt you'll have a problem there with a permalink conflict.

    Just something more to bear in mind.


  • jennybeaumont
    • Design Lord, Child of Thor

    Thanks guys! Ok, I will give the plugin a whirl and keep my eyes on things. Luckily I'm working in a safe dev space, so if I break something there will be no harm done :slight_smile:

    And I'll stop being tempted to touch the db :slight_smile:

    Have a great weekend!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.