8

Currently, permalinks are set to /%postname%/.

I'd like to prefix "blog" before all standard posts.

I'm using several custom post types, each with their own rewrite rules in the setup.

How can I setup a custom prefix for my standard WordPress posts?

1
  • 1
    This is not that easy, I would suggest just adding a category called blog. – Wyck May 19 '11 at 5:27
7

did you try defining your perm structure like: /blog/%postname%/

If each one of your custom post types has its own slug defined, this should work like you are asking.

6
  • 7
    It is possible that this will also add this prefix to the rewrite rules of your other custom post types. If it does, you should explicitly set the with_front parameter of the rewrite argument you use when registering the post type to false. Use my Rewrite analyzer plugin to see the new structure of all your rewrite rules to prevent surprises. – Jan Fabry May 19 '11 at 17:08
  • I'll give that a try. – Jonathan Wold May 19 '11 at 20:31
  • @Jan - Thank you for those additional details, I'll keep that in mind and take a look at the plugin accordingly - thank you! – Jonathan Wold May 19 '11 at 20:32
  • Sweet, Jan, with_front was exactly what I needed. – fregante Dec 9 '12 at 1:30
  • Same here! with_front nailed it. – Jonathan Wold Jan 21 '14 at 0:05

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.