3

Just installed Wordpress 3.8.1 multisite but can't remove the /blog/ slug. I've tried all suggestions for older versions of Wordpress (including the solutions to the question posted on this site 6 months ago regarding removing from root) to no avail. Anybody know how to fix this or if it's possible to fix?

I need two sites for a dual language website. Could a solution be to just create 3 sites and use the root site as an interface to the other sites, or should I use an alternative CMS?

2

I fixed this in the following way.

Go to the "Network admin". Then Sites → Edit → Settings → Permalink Structure. Remove blog from it.

Then I removed blog from two lines in table which obtained as a result of the query:

SELECT * FROM wp_options WHERE option_name = "permalink_structure" OR option_name = "rewrite_rules" 

Useful link on subject: How To Remove The /blog/ slug From The Permalinks(URL) in WordPress Multisite Installation Without A Plugin

This works with WP 3.8, I have not tried with 3.8.1

Note if you go to the main sites Setting -> Permalink you will still see blog, but it does not applied any more. But if you press "Save changes", blog slug will be used again. You need to redo previous actions again

-2

In your main install folder is: wp-admin/options-permalink.php

Change:

$prefix = $blog_prefix = '';
if ( ! got_url_rewrite() )
    $prefix = '/index.php';
if ( is_multisite() && !is_subdomain_install() && is_main_site() )
    $blog_prefix = '/blog';

if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) {
    check_admin_referer('update-permalink');

to:

$prefix = $blog_prefix = '';
if ( ! got_url_rewrite() )
    $prefix = '/index.php';
if ( is_multisite() && !is_subdomain_install() && is_main_site() )
    $blog_prefix = '/WHATEVER_SLUG_YOU_WANT_TO_CHANGE_IT_TO';

if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) {
    check_admin_referer('update-permalink');

Worked great for me, but you have to replace the slug with another I assume. (I did not try to leave it blank)

1
  • Editing core files is almost never a good suggestion. The changes you make will be overwritten when you update versions and may cause other problems with your site that you're not expecting. Mar 9 '14 at 17:15
-2

I couldn't get fixes for older versions to work with 3.8.1 either.

I just removed blog from the options-permalink.php - left it blank and it's working so far.... fingers crossed....

$prefix = $blog_prefix = '';
if ( ! got_url_rewrite() )
    $prefix = '/index.php';
if ( is_multisite() && !is_subdomain_install() && is_main_site() )
    $blog_prefix = '';
1
  • Are you saying that you hacked a Core file?
    – s_ha_dum
    Mar 9 '14 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.