0

I want to set my permalink as:

www.example.com/category/postid/postname

But I want WordPress to ignore the post name at the end, because I may change it later.

How can I do it with .htaccess, or is there another way?

1

Being in wp-admin/options-permalink.php (Permalinks) you can easily set this using Custom Structure:

/%post_id%/%postname%/

custom permalink structure

So you can browse the Hello World post with:

http://example.com/1/hello-world/

But if you strip out the postname from the URL like below:

http://example.com/1/

You can still access the Hello World post.

CAUTION Changing permalink in any live site may cause bad effect in SEO, and cause huge amount of 404 pages without proper redirection. So just think about it before switching to any changes in permalink.

2
  • What if I change the title? Will the old title work? Or it will be broken link ? Nov 1 '15 at 5:26
  • :) I changed my /hello-world/ post permalink to /somethjingas-dasd-sadsad/, it's still taking me to the #1 post that's previously "Hello World" :) Nov 1 '15 at 5:28

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.