Wordpress · Wordpress setup

How to add /blog/ to your URL only for blog posts in wordpress

Sometimes it is useful to separate your pages URL from blog posts,specially if you are using Google Analytics and want to group your content using the URL extraction method.

To add /blog/ to your URL is very easy, but if you have not done it from the beginning, all the URL’s will break and you will have to set up Redirect 301 on all of them. This can be a lot of work depending on how much content you have created.

But, let’s do this in steps,

Add /blog/ to your blog posts URL

It is very simple to add /blog/ to your posts URL, you only need to navigate to Settings > Permalinks:

and add /blog/ to the custom permalink setting:

add

This will change the URL of your blog posts but not of your pages.

Now you will have to take care of all the broken URL’s and redirect to the new URL:

Redirect to new URL after changing permalinks

Here is a great tutorial on how to do redirects in wordpress.

 

And you are done!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s