0

I am using simple/standard page hierarchy to get a permalink like: https://domain.com/county/city

I just want to put state at the end like this: https://domain.com/county/city-nj

I am unable to put "-nj" at end.

I tried to Custom Structure like: https://domain.com//%postname%-nj

But it doesn't work. What should I do?

0

I couldn't find a decent WordPress Way of doing this but a very effective Alternate. Please BACKUP your database before applying this solution.

I went to PHPMYADMIN and applied this query:

UPDATE wp_posts SET post_name = CONCAT(post_name,'-nj') where post_type = 'page' and post_parent <> 0

and all https://domain.com/county/city urls became https://domain.com/county/city-nj

Please note that all "CITY" pages are child page of "COUNTY" pages in my case.

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.