How I can use an absolute random post_id in wp-admin at wp_insert_post? I need stored in wp-admin a unique random post_id, but not I have only: 2210, 2212, 2214. As I understand it, this will not work because of the uniqueness of the keys in the database.

  • 2
    the post ID is the primary key of the table and cannot be modified. if you want a random and custom value for each post, you can set it in a post meta (update_post_meta) – Kaperto Dec 3 '19 at 12:33
  • What is the intention behind? Can you elaborate your goal? – Fabian Marz Dec 3 '19 at 13:14
  • the essence is this: when a user submits a request, a post is created in the admin panel: name, email, etc. and the user gets a unique number in the system by which he can find himself, for these purposes I need use number and slug name - random which consists of 10 digits, now in wp-admin via wp_insert_post i can get only short number – Lerry Dec 3 '19 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.