How to Import Categories with Descriptions from a CSV File?

Very simple plugin to achieve this. Runs only on activation, so, if there are 5 CSV files, the plugin must be activated/deactivated five times. File: /wp-content/plugins/create-cats-from-csv/create-cats-from-csv.php <?php /* Plugin Name: Insert CSV Categories Version: 1.0 Description: Reads a CSV file on plugin activation and insert the Categories/Description/Parent into WordPress as defined in the CSV Plugin … Read more

Convert a static website to a WordPress theme and import all existing content

WordPress has a perfect wrapper for HTML > Theme conversion: The theme itself. All information can be found in the Codex page. It is enough to add a folder to your wp-content/themes directory (or whatever directory you registered in addition to that), and add the following files functions.php style.css index.php header.php to your custom themename … Read more

Bulk action hook for admin pages which uses WP_List_Table

You have to use “process_bulk_action” function like this: public function process_bulk_action() { //nonce validations,etc $action = $this->current_action(); switch ( $action ) { case ‘export_action’: // Do whatever you want wp_redirect( esc_url( add_query_arg() ) ); break; default: // do nothing or something else return; break; } return; } } If you need a complete example this … Read more

Updating User Meta with SQL Query

How can I write a bulk MySQL command to add in the value wp_capabilites=”a:1:{s:10:”subscriber”;b:1;}” into each user_id except 1, 2 and 3 ie. the newly imported users? You don’t. That is a serialized array which is a PHP construct. MySQL has no idea what to do with it. To the database, it is just an … Read more

WXR import problem — not including categories

Maybe this is the answer: http://mansurovs.com/tech/wordpress-does-not-import-categories-and-tags (from there) : Make sure not to delete the original “Hello World!” post that gets automatically created by WordPress. If you have already deleted it, create a new dummy post that you can later delete. Make sure that the WordPress import process is successfully finished. After all posts and … Read more