How To Change The WordPress Posts Permalink To /blog/

Authored By: James LePage
Published On: May 3, 2020

Affiliate Disclosure: Some links on this website are affiliate links. We make commissions for purchases made through those links.

We only recommend items/tools that we've personally used and like.

Full Disclosure | FTC Statement

Changing the permalink to display /blog/ before the post specific information is a difficult task if you have custom post types in your site, as the "standard" way of doing things applies to all post types.

Here's the issue. You want to change isotropic.co/super-cool-blog-post to be isotropic.co/blog/super-cool-blog-post.

First, if you're not running custom post types, here's how to change the slug to show blog.

Simply go to Settings --> Permalinks and add this custom permalink structure:

/blog/%postname%/

Click save, and you've got a blog in your slug.

The default to change this way works well if you're not running custom post types, but if you are, it ruins the slug. Here's what I mean.

Assume you have a custom post type for /services. If you change all post permalinks to show /blog/post-title, then your slug for services becomes /blog/services/service-title. We only want the new blog permalink structure to apply to blog posts.

With custom posts, the best way to fix this issue is to turn off "Front Matter". You do this by adding a PHP snippet. Simple set "with_front" to false. For example, if we had services as a custom post type, and didn't want our /blog permalink structure to apply for it, we'd add this code:

'rewrite' => array('slug' => 'services', 'with_front' => false),

The way to add this code is super simple. We use a plugin called Code Snippets -- simply install it, paste the code into a new Snippet, then save and activate it. Go back to your permalink settings and click "save" to flush the previous settings.

Read more here: https://codex.wordpress.org/Function_Reference/register_post_type

Join Our Growing Mailing List Of Design Crazed Individuals

Expertly curated emails that will help you generate more income through good design.

You're in the club 💪.

Something went wrong.

James LePage is the founder of Isotropic Design, a digital agency that builds WordPress websites. I read, write and design constantly!

Social Share

Crafting Stunning Digital Appearances & Assets Out Of New York.
Get In Touch
Syracuse, NY | Charlotte, NC | New York, NY
© 2020 Isotropic, LLC
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram

Join Our Growing Mailing List Of Design Crazed Individuals

Expertly curated emails that will help you generate more income through good design.

You're in the club 💪.

Something went wrong.