WordPress custom options storing?

WordPress is built to import and export content. As such, there is no built-in way to import or export settings. Some theme and plugin authors, however, have built tools into their systems that import/export XML files that their systems can use store options. A great example is WordPress SEO by Yoast. Not only can you …

Read more

Are there any scripts, classes, and/or functions built-in to WP for a plugin to export/import its saved data from wp_options?

The only native import/export facility is the one under Tools in the admin. And even that needs an extension (plugin) for importing from different formats. It’s pretty straightforward to build one yourself. Something along the lines of: $options = get_my_options(); header( ‘Content-disposition: attachment; filename=my_export.txt’ ); header( ‘Content-Type: text/plain’ ); echo json_encode( $options ); exit; And …

Read more

Export / import WordPress database

I normally use mysqldump and sed: on old server: mysqldump -u user -p OldWpdatabase > wpdb.sql sed -i ‘s/oldurl/newurl/g’ wpdb.sql on new server: mysql -u user -p NewWpdatabase < wpdb.sql sed is used to search and replace all the hard coded occurrences of the website if needed.

Update Attached Image Size after Import

I’ve just had this or a very similar problem (I didn’t use the WP export tool, but instead did a manual migration from one environment to another). As far as I can tell, the problem occurs because of how WP stores the thumbnail data in the the wp_postmeta table (with the key ‘_wp_attachment_metadata’). This data …

Read more

WordPress export tool doesn’t export post-format value of custom post type?

After spending time debugging export.php, I found that we have to register post_format taxonomy for our custom post type. register_taxonomy( ‘post_format’, ‘portfolio’, array( ‘public’ => true, ‘hierarchical’ => false, ‘labels’ => array( ‘name’ => _x( ‘Format’, ‘post format’ ), ‘singular_name’ => _x( ‘Format’, ‘post format’ ), ), ‘query_var’ => true, ‘rewrite’ => $rewrite[‘post_format’], ‘show_ui’ => …

Read more