@sorich87’s answer is 99% there. The difference is that All-in-One SEO Pack follows certain best practices and uses a prefix of '_aioseop_'
on its meta keys. That makes the actual working code look more like this:
$my_post = array(
'post_title' => 'title',
'post_content' => $post,
'post_status' => 'publish',
'post_author' => 1,
'post_date' => date('Y-m-d H:i:s', $oldtime),
'post_category' => array(3,4)
);
$post_id = wp_insert_post( $my_post );
if( !is_wp_error($post_id) && $post_id > 0 ) {
add_post_meta($post_id, '_aioseop_keywords', $keywords);
add_post_meta($post_id, '_aioseop_description', $description);
add_post_meta($post_id, '_aioseop_title', $title);
}
Here’s a screenshot of the All-in-One SEO Pack specific records in the wp_postmeta
table of my test system using Navicat for MySQL to view them:
(source: mikeschinkel.com)
Related Posts:
- How Do I Use The WordPress Plugin Posts 2 Posts by Scribu?
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- Disallow a user to post in certain categories
- Article source link for posts
- Publish Post After Click On A Link
- Get the last post ID
- Custom Post Type causes Page Not Found
- Unique post-id for WordPress Multisite Network
- Is there an action that is called when a post is restored from the trash?
- Replace existing pages with new pages, keep menu links
- Adding “ ” before the last word in multiple defined areas with a plugin
- How to change ID of an attachment in wp_posts and its related tables correctly?
- CKEditor: Uncaught TypeError: switchEditors.switchto is not a functiononclick
- Using the “Latest posts” feature on a different site
- Is there a way to order posts and custom post types as one group?
- Execute a plugin only on post pages
- Cron job not firing
- How do I “get the next 10 posts after post_id == x”?
- Calendar Solution: Handling upcoming Dates with Posts?
- get_post_type on post.php
- Is there an easy way to flag posts in the admin area?
- finding whether request is for post, and post id
- Can’t delete Draft Post [closed]
- Outbound link autometic converted into linkdirect , and not opening
- Display by Category in Admin
- Contributive page where people logged in can write
- Trying to fix form resubmition with PRG (Getting error: Cannot modify header information – headers already sent by)
- Display wordpress post’s in popup?
- Redirect to another page using contact form 7? [closed]
- AJAX fileupload – TypeError: not a function ajaxSubmit()
- Is it possible to send blog posts via email to subscribers?
- Is there any plugin which can paste a common content to my every post?
- Recent posts per category loop?
- ‘Organize Series Plugin’ as muti author feature
- Problem of encoding characters (apostrophes) in my posts publications
- How to backup single post in wordpress [closed]
- Is there a way to make the main page only display a brief description of the full article?
- How to change the post form from plugin?
- Allowing users to Sign-up > Login > Post articles that need approval
- How to display the featured post on the category page?
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- Is there a plugin or a way in the wordpress that would let us have different versions of a post or page accessibe to users?
- download button for audio file in post [closed]
- check uncategorized category by default
- Print posts category or tag as a formatted journal
- Post deleted in trash [closed]
- How to relate 3 wordpress components with each other (Create database relationships)
- What hook can I use to modify custom post data before it is displayed on the page?
- get current page number with wp_link_pages()
- problem with register_activation_hook in plugin
- Delete data from custom table when deleting a post
- Plugin is creating posts twice
- How to write a new file when new post has been published in WordPress
- How to Get Recent 5 post in My Title bar?
- How to get Recent Post From Each Category with Thumbnail?
- Plugin for visitors to edit content without logging in? [closed]
- WP Insert Post If user refreshes override new post
- Summary and Comments on Main landing Page
- Error activating certain plugins
- Method/Plugin/Hack to Start a Post with an Writing Outline?
- What snippet do I need to type to show my ACF field show up on my theme?
- Is there a way to make [Table Of Content] plugin while not using revision data?
- Is it possible to pin a post in second position from top
- Oops! That page can’t be found
- page duplication on wordpress that wont stop
- Copy/paste local images not working in WordPress
- How to change my 3000 Published post status to Draft using PHPMyAdmin
- WordPress is redirecting me to homepage
- Adding custom post category to categories widget
- How can I see $post object in frontend from functions.php?
- Allow members to create groups on my site
- All Post WordPress Page Error
- How to wrap image tag into div for post only?
- My own metabox checkbox plugin only saves the last value I’ve checked
- How to prevent authors from editing their post count?
- Is there any hook to change media html in post? [duplicate]
- How to force regenerate thumbnails in WordPress posts?
- Publish Post but don’t call publish hook in foreground post creation
- Serialize $_POST global in wordpress
- How to use shortcode of any plugin to show it visually where i want?
- WordPress not updating post or disable plugin instead a white page appear
- get post excerpt by query
- Ger posts from similar tags and categories
- Internationalization of Blog Posts
- Issues with Post 2 Post Plugin
- How to add character to content of post?
- single.php fires more than once after clicking on any post to view with different post id each time
- Twitter List Tweets and Delicious Links as Posts
- Custom feed parameters / Template overriding
- How to make only selected posts appear on a selected wordpress page
- How to block external download link access if visitor not referred from WP?
- Plugin to display text before a post
- Notifications Bar on home page only
- Distribute post content through several divs [closed]
- Does anyone have the Custom Post Permalinks plugin from John P. Bloch? [closed]
- How to get an error message if a form is empty (plugin: Post for site) [closed]
- How to customized post slider layout in elementor wordpress [closed]
- How to export post tags from wordpress
- Show WooCommerce products based on query parameters on redirect
- Getting 400 Error in wordpress website