Import custom database into wp and keep the post id
The simplest way would be to export your old site’s posts from phpmyadmin, manually edit the .sql file that you download and then upload the new file to your site’s database from phpmyadmin again!
The simplest way would be to export your old site’s posts from phpmyadmin, manually edit the .sql file that you download and then upload the new file to your site’s database from phpmyadmin again!
I’d do something along the lines: Prepare a spreadsheet with all the data to be exported as CSV Use a plugin to import: Importing data from spreadsheet into wordpress DB, along with custom taxonomies and their terms Or custom code: How to Import Categories with Descriptions from a CSV File? If possible, use a development … Read more
Don’t even start. Ignoring official API is a no go, at best it will just creat headache for you and nasty surprise for the users when the plugin will fail when pinterest changes something and since it forces you to….. store user and password in a very unsecure way. This might be ok if your … Read more
From quick look at the code the post data mostly goes straight into wp_insert_post(), which is a low level function and serves to just store whatever you give it. If you want to enforce the check you could make use of wp_import_post_data_raw filter and probably wp_kses_post().
It depends on from where you will be importing the articles. You can check the codex to see what existing solutions exist. If you are using custom CMS you can use [X]HTML guide: <item> <pubDate>Wed, 30 Jan 2009 12:00:00 +0000</pubDate> <category>Kites</category> <category>Taiwan</category> <title>Fun times</title> <content:encoded><p>What great times we had…</p><p>And then Bob…</p></content:encoded> </item> <item>…
Import can be used for adding new “items” to wordpress, but not changing existing ones. If you want to update anything you should use the xml-rpc protocol with the relevant commands https://codex.wordpress.org/XML-RPC_WordPress_API, or if you need it only locally wpcli http://wp-cli.org/ might be even better (never used it for your specific type of change but … Read more
UPDATE SOLVED I change my code to wp_insert_user beside bp_core_user_signup $user_id = wp_insert_user(array( ‘user_login’ => $user_login, ‘user_pass’ => wp_hash_password( $email ), ‘first_name’ => $first_name, ‘last_name’ => $last_name, ‘display_name’ => $first_name . ‘ ‘ . $last_name, ‘user_email’ => $email, ‘user_nicename’ => $first_name
We can use the existing meta property (see docs) to add multiple meta fields (in a JSON format) when we create a post via POST method: POST: example.com/wp-json/wp/v2/posts/ Body payload: { “title”: “My title”, “content”: “My content”, “meta”: {“myfield1″:”myvalue1”, “myfield2″:”myvalue2”} } or when we want to update a post with ID 123: POST: example.com/wp-json/wp/v2/posts/123 Body … Read more
It sounds like you’re running into the server’s timeout setting (usually between 30 and 60 seconds). Once you hit that point, the page stops loading and returns as much as has been processed. In your case, I would try loading portions of the csv as pages just like paging through posts in WordPress. If you … Read more
As far as I know there is nothing native in WP to parse CSV files and stuffing this into database directly doesn’t seem like a good idea either. You can parse your CSV with PHP, see fgetcsv() for starters. Then use update_user_meta() to create those values.