WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Best way to remove /blog slug Wordress 3.4 Multisite (13 posts)

  1. jtt89
    Member
    Posted 1 year ago #

    I've seen some plugins, but none of them seem to be working. I read some post, but most of them seem to be at least 1-2 years old. Is there any good way to get rid of blog from a root page URL?

    Thank you.

  2. Edit the site via network admin -> sites

    Click on settings and scroll till you find the permalink settings.

    Remove blog.

    Now bear in mind, should you ever change permalinks on the main site, you will have to go back and do that again.

  3. jtt89
    Member
    Posted 1 year ago #

    I tried it before, and it doesnt work. /blog remains in Settings -> Permalinks -> (Custom Structure), so I get:

    http://domain-name.com/blog/category-names
    http://domain-name.com/blog/post-name

    I use Yoast SEO plugin, also, but "Strip the category base (usually /category/) from the category URL" doesnt work on the root blog.

    I was thinking about making some changes in the code, instead of using a plugin, but I am not sure if thats possible.

    Thank you in advance for any info.

  4. Touch core and you kill kittens. Please, just don't.

    Anyway, yes, blog will always remain in settings -> Permalinks. It's hard coded. But if you don't save permalinks on that page, it won't show up.

    Make your custom structure whatever you want. Then go do what I said :) It works. tested on 3.4 just now.

  5. cjgroove
    Member
    Posted 1 year ago #

    I did what you said to do and removed /blog in the settings area. Now,all of my pages, posts, etc say "Sorry Page Not Found"

    What do I do?

  6. cjgroove
    Member
    Posted 1 year ago #

    Correction: The "pages" are showing up, but the category and posts are not.

  7. cjgroove
    Member
    Posted 1 year ago #

    Nevermind! Got it! Thanks!

  8. jtt89
    Member
    Posted 1 year ago #

    I went to Network Admin -> Sites -> (root site) Edit -> Settings (tab), and entered "%postname%" in "Permalink Structure" field (after some experimenting with leaving it blank etc)

    When I click on a post name I am getting the correct

    http://domain-name.com/post-name

    , but when I click on one of the category names, I am still getting

    http://domain-name.com/blog/category-name

    I went to (root site) Dashboard -> SEO (Yoast SEO plugin) -> Permalinks, and unchecked "Strip the category base (usually /category/) from the category URL" and got the following:

    http://domain-name.com/category/category-name

    After checking it back again it goes back to

    http://domain-name.com/blog/category-name

    ...and I made sure to go back to the Site Settings, and saving the %postname% in "Permalink Structure" as the last thing that I was doing before going to the site etc...

    So basically, I was able to get rid from /blog slug from a post name URL, but it still remains in the URL in a category name. If I dont enter postname, and leave it blank I get http://domain-name.com/?p=123, or any of the other options (instead of a post name that I want)

  9. On the settings page, look at Category Base.

    I can't reproduce that on a clean 3.4 build.

  10. jtt89
    Member
    Posted 1 year ago #

    I dont have anything in Network Admin -> Sites -> (root site) Edit -> "Category base", and I am showing /blog slug in the URL for category pages.

    When I go to (root site) Dashboard -> SEO (Yoast SEO plugin)-> Permalinks, and uncheck "Strip the category base (usually /category/) from the category URL" it is showing /category instead of the /blog, and when I check it again it is coming back to /blog.

    I've been trying all combinations for a while, and /blog on category pages is hard to get rid of. I tried a cc-remove-blog-slug-v-1.1 plugin, but it doesnt work also. So basically the /blog slug on category pages is still there...

  11. $30 says that Yoast's 'resaving' permalinks, which would force the /blog/ back in.

    Leave Yoast's plugin alone. yes, let it be wrong.

    Go in and change it in Network Admin.

    Go to the front of your site. How does it work?

  12. jtt89
    Member
    Posted 1 year ago #

    I would say that the solution to this one would be modifying settings in Network Admin - Sites -> (root site) Edit -> Settings -> "Permalink Structure" (%postname%) and "Category Base" (%category), whatever configuration works, and the following plugin:

    http://wordpress.org/extend/plugins/no-category-base-wpml/

    I was able to keep Yoast SEO for WordPress also.

    Thank you for the info.

  13. Adelinaborn
    Member
    Posted 1 year ago #

    I was quite new for me. Thank you very much.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.