We’re finding that our clients’ sites are more and more often websites first, and blogs second. As such, typical landing pages are placed in the root, and their children are placed beneath them in the URL hierarchy like this:
- Product Landing Page: http://www.wordpress-website.com/our-products/
- Product Detail Page: http://www.wordpress-website.com/our-products/some-product/
With this structure in place, clients expect their WordPress blog to use a similar format:
- Blog Landing Page: http://www.wordpress-website.com/blog/
- Blog Post Page: http://www.wordpress-website.com/blog/some-exciting-blog-post/
Fortunately, this is pretty quick to do for your site using WordPress’ permalinks settings. Just set your custom permalink structure to:
/blog/%postname%/
If you have any custom post types used on your site, you’ll need to make sure that they don’t get the /blog/ prepended to their URLs. To remove it, simply set with_front
to false
where the custom post types are registered:
'rewrite' => array('slug' => 'portfolio', 'with_front' => false),
You should also flush the WordPress rewrite rules after making this change – just go back to Settings > Permalinks and hit save.