I did this and it gave me a post with the set import_id
:
$my_post = array(
'import_id' => 1234567890,
'post_title' => 'Custom ID',
'post_content' => 'This post has a custom ID.',
'post_status' => 'publish',
);
wp_insert_post( $my_post );
In addition this will raise ID/index to the integer you set in the import_id so that subsequent posts’ ids will be incremented form there (ie. 1234567891, 1234567892, etc.) – allowing you to use your large integer as a base for your posts with custom IDs.
Please give it a try and let me know how it goes.
Related Posts:
- How to display by default only published posts/pages in the admin area?
- Is there an if statement that can determine if a post in the loop is the last post?
- WP_Query: Why is sticky post not first item in loop?
- Is there a way to disable the sticky posts feature?
- How to remove Nextpage tag inside posts text depending of utm_campaign
- using slug instead of ID in admin edit post url
- Can I load posts via Ajax?
- Filter posts by author and category simultaneously
- Custom colors for post rows based on post meta value
- All WordPress scheduled posts are being published immediately
- WordPress Delete hook with wp_delete_post function?
- Undelete post (untrash)?
- Delete Post From Front-End and attachment permanently
- Hide Post comments when displayed via WP_Query
- Double count view in archive.php
- disable column on post and user list
- Multiple social buttons with a fast loading? [closed]
- How can I display widget in a Page or Post?
- Different style for most recent article
- How can I replace the text at the top of a custom column into a icon?
- count the total number of comments the user has received for his published posts
- How to Orderby Comments by post title?
- If modified on same day, show only time
- How is a gallery associated with some post in database?
- Multiple posts with fixed order position
- Display Meta Values in Custom Filter – Admin Custom Posts
- Automatically add custom fields value to wordpress post
- How to use format post in a pertinent way
- Get user categories with most posts in it
- How to create media library for each user?
- How to display two blog categories as separate sections on one page?
- Retrieve post ID from “querying” URL
- When open add new post or page WordPress add post with ID=0 continuously [closed]
- Thumbnail & Category link aside post
- My wordpress based site is publishing the same post twice
- How to make a sum of all posts displayed in a loop
- First x post with another template then the others
- When creating a post how do you select the format?
- How can I post exact same post but with a few things changed? (with some sort of Automation)
- Assign published posts to another user automatically
- add bootstrap post slider with tabs
- Show all posts shows a blank white page in WP 4.2.2 [closed]
- Fast publishing in wordpress
- Getting Duplicate Posts on Home Page with Widget Added Between Posts
- Add Blog to WP homepage Manually
- How to show all posts by author on buddypress profile with navigation
- Get URL from all images in a post
- Change the default blog post post attribute template name from “default template” to something else
- Getting property of non-object when looping through post objects from ACF
- How to get the ability to change the author of a post
- Defined function isn’t showed on page
- single post showing blank page in custom template
- How to enable custom Shortcodes in Post Category Description? [duplicate]
- If no posts exist for current day and month, show the next available day of posts
- How can I get rid of the automatically generating tags?
- Get latest post from categories
- Simple Custom Metabox Not Saving
- Access last visit time to a post
- Loop not showing first post
- How to show a featured image inside a post in only 1 single category
- Custom Post Type Single Loop Outputting Wrong Post
- Is there a function to get post info for any publish_status by post ID?
- Geting error in post and category [closed]
- WordPress Post Deletion Issue
- Display a specific category in a focused area of my site
- How to remove the ManageBlocksMenuItem in the ToolsMoreMenuGroup in the Gutenberg Editor?
- Target only single product page
- Posting an article containing mathematical symbols and R code
- Bulk find & replace on WordPress posts/pages (minus image paths)
- How can get the last post date of the user?
- How to convert attachment pages to Posts?
- Remove HTML tags from all posts
- How to 301 redirect from url with post id to permalink with post name (slug)?
- Create/Set Category as Title of Post
- Blocked posts in network tab
- how can i fix my display post in my index.php
- Ajax post doesnt call succes after got the response
- Adding a ‘section’ to the backend menu
- Get 5 most recent categories
- Allow reader to reorder posts for themselves (oldest first)
- Is it possible to completely replace a post with an action/filter?
- Surrogate ID for posts, is there an alternative field in the posts table?
- List of authors posts minus very latest
- How do I get thumbnails?
- Add category attribute to custom recent post shortcode
- How can I show my post under a certain content name?
- How Can I Limit Users to Post Creation For My Frontend Theme?
- how to create add-able metaboxes in wordpress post edit screen?
- How to display only one post on first category page and rest on next pages?
- Show Custom Post From Logged In Author
- How to display a paginated list of posts from one category on a page? [duplicate]
- Is there a way to separate wordpress titles from their posts?
- Get attachment if matches a variable
- custom sort posts in archive/taxanomy page
- Trying to create shortcode listing custom posts, but formating not being included
- Show Title/Date/Excerpt of first post & only Title for rest in Query [duplicate]
- remove description in colum title post
- Show some texts in posts belonging to Specific category
- how to change background color of my all post
- WordPress Post Updating is Not Working