I have a wordpress website with bunch of posts.
My problem is that I need to change the URLs from
website.com/post-name
to
website.com/specialword/post-name
The “specialword” is what I need to add in front of those post names, but ONLY for the post type – posts.
Can someone help me?
I need this badly, mostly because of the SEO purposes so I can keep the URLs from the previous website that wasn’t done in wordpress.
Thank you!
Slavisa
You can do it from
Settings > Permalinks
.Select the
Custom Structure
radio button, and put this in the text field next to it:Works.
I think the only (the easiest) solution is to change
permastruct
s for custom post types after registering them and add your ‘magic word’ to permalink structure.So set (in parmalinks settings) your permalink structure to:
/my-magic-word/%postname%/
and then manually modify permastructs of your custom post types.You can do this like so (add it to your functions.php file):
Then go to permalink settings and save them to flush rewrite rules.
PS. I think you could try to use
with_front
param, but I’m not sure if it will be easier (or if it even will work) than this solution.