How To Remove a Blog from a WordPress Multisite Url

The word “blog” appearing in the URL on WordPress multisite setups is a bug bear for many ( you are definitely not alone ).

The WordPress Settings Permalink Structure screen shot below illustrates the problem. The “blog” keyword appears hardcoded in the screen permalinks. We don’t want the “blog” keyword. Below are the steps required to remove “blog” from the WordPress Permalink Structure screen and Multisite Url.

WordPress Permalink Settings Screen

This is the WordPress Permalink Settings screen.

Howto Remove blog keyword from Permalink structure on WordPress multisites installation

How to Remove “blog” keyword

These are the 3 steps summarized for removing the “blog” word. The detail is given below. But if you want to know the summary beginning to end – it is only 3 steps and they are to

  1. change the individual site “Permalink Settings Screen”
  2. change the Network Admin Sites “Settings” tab screen”
  3. update a row in wp_options table (MySQL WordPress DB)

Sometimes the above screen stays wrong but IT WORKS!

Just do the 3 steps. Sometimes the above screen STAYS WRONG with the blog keyword embedded. Don’t Worry! Test it by creating a post and linking to old posts.The blog slug should have gone, there should be NO 404 errors, and even the old ones should work.

If the permalink structure screen wants to show you a blog slug – let it. It’s frustrating, but like we said earlier – you are not alone. Play the song and move on.

3 Steps for How to Remove the “blog” Word

1 – Choose the “Default” Option

On the permalink settings screen choose either the “Default” option or the “Post name” option depending on which you desire. The others will likely cause famous 404 (page cannot be retrieved) errors when you click on the post links.

2 – Delete /blog on Network Admin Settings

Go to the Network Admin section. Click on Sites then choose the first site from the list. Now you have 4 tabs. Click on the 4th tab and now you get that phat long string with scores of configuration directives.

At this point you scroll down to the setting labelled “Permalink Structure” – It should be something like /blog/%postname%/. Amputate the first 5 characters “/blog” from the permalink structure setting.

Then scroll to the very bottom and click save.

3 – Update the wp_options table

You can use PhpMyAdmin or just the plain old command line (POCLI). The middle command is what makes the change. The command is

UPDATE wp_options SET option_value=”/%postname%/” WHERE option_name=”permalink_structure”;

The Select Query, the Update Query and the Select (again) Query

Notice the change in the option_value column

mysql> select * from wp_options where option_name="permalink_structure"; +-----------+---------------------+--------------+----------+ | option_id | option_name | option_value | autoload | +-----------+---------------------+--------------+----------+ | 28 | permalink_structure | | yes | +-----------+---------------------+--------------+----------+ 1 row in set (0.00 sec) mysql> UPDATE wp_options SET option_value="/%postname%/" WHERE option_name="permalink_structure"; Query OK, 1 row affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> select * from wp_options where option_name="permalink_structure"; +-----------+---------------------+--------------+----------+ | option_id | option_name | option_value | autoload | +-----------+---------------------+--------------+----------+ | 28 | permalink_structure | /%postname%/ | yes | +-----------+---------------------+--------------+----------+ 1 row in set (0.00 sec)

That’s it. You are done – now don’t worry if the first screen shot in this post still has those blog words in it. Test it. It will work. But let me know either way because it gives other struggling WordPress afficionados faith – that this method does indeed work.

Leave a Reply

Your email address will not be published. Required fields are marked *