Convert comma separated list to serialized array to import as post meta

If you need to do this conversion in PHP, as part of whatever import process, then you can just convert the comma-separated values into an array with explode(), and then use update_post_meta(), which will automatically serialise the value for you: $value=”Morning,Daytime”; $array = explode( ‘,’, $value ); update_post_meta( $post_id, ‘hours_of_operation’, $array ); Use trim() if … Read more

How to import nested categories from XML file?

The following code snippet did the trick: <wp:term> <wp:term_id><![CDATA[1]]></wp:term_id> <wp:term_taxonomy><![CDATA[category]]></wp:term_taxonomy> <wp:term_slug><![CDATA[test-category-1]]></wp:term_slug> <wp:term_parent><![CDATA[]]></wp:term_parent> <wp:term_name><![CDATA[Test Category 1]]></wp:term_name> </wp:term> <wp:term> <wp:term_id><![CDATA[2]]></wp:term_id> <wp:term_taxonomy><![CDATA[category]]></wp:term_taxonomy> <wp:term_slug><![CDATA[sub-category-1]]></wp:term_slug> <wp:term_parent><![CDATA[test-category-1]]></wp:term_parent> <wp:term_name><![CDATA[Sub Category 1]]></wp:term_name> </wp:term>

Import HTML/JS post to WordPress?

You could put this in as a theme page template. This would let you continue modifying your custom code. Whatever you do, avoid plugins that let you put raw php in your posts. It’s a huge security vulnerability, and it would let people do things such as submit draft posts containing shell scripts to turn … Read more

Importer fails to import every post

Open the WXR in a text editor and see if it contains posts from later years. If not, you will need to revisit your export settings from WP.com to make sure you’re pulling all posts. If it does contain posts from these years, there might be a non UTF8 character breaking the import. You should … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)