How do I change the blog slug in multisite

Hi everyone

Can anyone tell me how to change the blog slug for all of the blogs on a multisite installation?

Current it is set to subdomain.domain.com/year/month/day/post_name/

I want it to be subdomain.domain.com/blog/year/month/day/post_name/

Thanks,

Joe

  • DavidM
    • DEV MAN’s Mascot

    Hi there Joe,

    Hope your project’s going great! :slight_smile:

    Those slugs would be changed from each site’s Permalinks settings page:

    yoursite.com/wp-admin/options-permalink.php

    Just to mention too, you could potentially use New Blog Templates to setup a templated site with a specific permalink setting and when set as the default template, all your new sites will have that set.

    Would that work for you?

    Cheers,

    David

  • Joe
    • Design Lord, Child of Thor

    Hi David

    Thanks for your response. I am very close to releasing my site to some beta testers now – just need to tidy up a few things.

    The permalinks menu was what I was looking for i think. For some reason I could not find a menu option for it.

    I have updated the custom structure to this:

    /blog/%year%/%monthnum%/%day%/%postname%.html

    Now, these urls work:

    /blog/%year%/%monthnum%/%day%

    /blog/%year%/%monthnum%

    /blog/%year%

    But this one doesnt:

    /blog

    Any ideas how I can get that one to work?

    Thanks,

    Joe

  • Joe
    • Design Lord, Child of Thor

    After doing some research I found that this isnt an easy thing to accomplish. Lots of people have asked the same question on stack exchange, but no one has got a good solution.

    Perhaps this could be solved with a new plugin from wpmudev ? It would definitely be popular!

    Joe

  • DavidM
    • DEV MAN’s Mascot

    Hi again @joe,

    It wouldn’t work if left blank but you could use this:

    /blog/%postname%

    However, if you’re trying to get rid of the /blog/ slug entirely, you might consider the method mentioned here:

    http://wordpress.org/support/topic/why-wp-multisite-force-blog-slug-how-to-remove-it?replies=12

    The thing is, the reason the /blug/ slug exists is to keep safe from conflicting slugs. If you have a post name that is the same as a page name, you’ll have a conflict unless that /blog/ or similar slug is there to differentiate them.

    Just something to keep in mind. :slight_smile:

    Cheers,

    David

  • Joe
    • Design Lord, Child of Thor

    Hi David

    Thanks for your reply.

    I’m not trying to remove the slug – I dont have one! I am trying to add the slug so that I can have the blog content contained within a separate folder from the pages.

    Does that make sense?

    Joe

  • DavidM
    • DEV MAN’s Mascot

    Hi Joe,

    Yep, that makes perfect sense and thanks for clarifying. I misunderstood and thought you might be trying to alter the default /blog/ slug.

    I see what the problem is now though. Would it work if you created a new Page with a /blog/ slug?

    If you’re using a static homepage you could set this blog page as your Posts page in Settings > Reading.

    Would that work for you?

  • Joe
    • Design Lord, Child of Thor

    Hi David

    I dont think that hack wold work for all of my users – not all of them would want a list of blog posts on the font page.

    I think what I need is a plugin where a slug can be added just for the blog posts.

    Joe

  • DavidM
    • DEV MAN’s Mascot

    Hi Joe,

    I can’t seem to find a plugin that does specifically that, not sure if one exists.

    There’s something to consider with that too, which is why I think it’s not commonly done. For SEO purposes, generally the shorter the url, the better. Having /blog/ in all blog post urls works against that SEO practice.

    If you’re looking to do that still, another workaround would be to create a custom post type, perhaps called Articles, and have the base slug for that be /blog/.

    You could use CustomPress for that matter.

    Cheers,

    David

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.