How Do I Merge Categories With phpMyAdmin

You can’t simply “merge categories” you have to change the category that each post is associated with. The table WP_TERM_RELATIONSHIPS links posts with categories. You could try something like this: UPDATE wp_term_relationships SET term_taxonomy_id = (SELECT term_taxonomy_id FROM wp_term_taxonomy WHERE term_id = 112748) WHERE term_taxonomy_id = (SELECT term_taxonomy_id FROM wp_term_taxonomy WHERE term_id = 112747) You … Read more

Set Display Name to first and last name (phpmyadmin SQL Query)

I know this is an old question, but for anyone still looking how to achieve this, the following query should do the job: UPDATE wp_users INNER JOIN wp_usermeta AS fn_meta ON wp_users.ID = fn_meta.user_id AND fn_meta.meta_key = ‘first_name’ INNER JOIN wp_usermeta AS ln_meta ON wp_users.ID = ln_meta.user_id AND ln_meta.meta_key = ‘last_name’ SET wp_users.display_name = CONCAT(fn_meta.meta_value, … Read more

Issue with foreach on duplicate meta_key’s

Here is an example of getting the user IDs, looping through each, grabbing a meta_key as an array, adding new values to it and remove old values, saving the meta back, then grabbing it again to loop through each item in the array for output. Array is just an example of duplicate keys. $user_query = … Read more

Delete database tables on theme uninstall?

Yes, you can accomplish it by WP default functionality. Let me explain it. 1. While switch theme: There is a switch_theme action that runs right after the theme is switched. switch_theme is triggered when the blog’s theme is changed. Specifically, it fires after the theme has been switched but before the next request. Theme developers … Read more

How to Move Local Singlesite Database to Remote Multsite Database?

Merging WordPress Standalone Installation with WordPress Multisite Installation Before You Begin: Create a new site in your Multisite Network, which will be the site you’re migrating from the Standalone installation. (Take note of the site ID #, you’ll need it later.) You need to make sure that all of the users from the Standalone installation, … Read more