1

I'm using wp_insert_post on my WordPress project to programmatically generate posts.

The posts that it generates can be accessed by the ugly permalink (http://codex.wordpress.org/Using_Permalinks) of the form /?p=<POST_ID>; where POST_ID is an auto-incremented identification number.

Is there a way to create a post so that instead of an auto-incremented POST_ID, it uses a globally unique identifier (e.g.: /?p=3de6819c080d978910d56ad3a0d9f62b)?

If that's not possible, is there a way to disable ugly permalinks for a post so that the post can only be accessed via pretty permalinks?

mandelbaum
  • 188
  • 8
  • If you have pretty permalinks set within your Wordpress, If someone tries to access through the ugly permalink `?p=` they will be redirect to the pretty ones `/post-slug`. – Rahil Wazir Mar 13 '14 at 19:30
  • Yeah, which is what I don't want to happen. I want the URL to be secret so that people can't input random ID's and discover these posts. – mandelbaum Mar 13 '14 at 20:53
  • Why you want to hide the ID? Whats the purpose? If they did as i said they will be redirected to their original post. – Rahil Wazir Mar 13 '14 at 22:12
  • The post is private. I only want the person who created the post to be able access it. Therefore, the ID has to be a random unique number so that intruders can't guess random ID numbers and discover the private posts. e.g.) A post that is accessed via "/?p=256" could be easily discovered by an intruder, they could just open a web browser and guess random numbers. A post that is accessed via "/?p=3de6819c080d978910d56ad3a0d9f62b" is not easily discoverable. This post discusses secret url's in better detail: http://stackoverflow.com/questions/4833314/are-secret-urls-truly-secure – mandelbaum Mar 13 '14 at 22:43

0 Answers0