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

Query to change custom post type with specific category

I would do it in php in two parts rather than one big raw sql statement, for safety reasons, eg in your “functions.php” put: function wpse160706() { $old_post_type=”films”; $new_post_type=”post”; $category_slug = ‘directors’; $taxonomy = ‘category’; global $wpdb; $sql = $wpdb->prepare( ‘SELECT p.ID FROM ‘ . $wpdb->posts . ‘ AS p’ . ‘ JOIN ‘ . … 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

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

How to do a MySQL dump from production site without using a search and replace script for local development?

What you posted will work fine for all links that are generated by WordPress: permalinks, script/style enqueues for local files, featured images, etc. I tend to define my Site URL and Home URL dynamically like this: <?php define(‘WP_HOME’, ‘http://’ . $_SERVER[‘HTTP_HOST’]); define(‘WP_SITEURL’, WP_HOME . ‘/wp’); Note: HTTP_HOST isn’t always present, use with caution As far … Read more

unable to upload image locally

You need to change the file permissions on your wp-content folder (and containing folders) to 755. On your setup you can do this with: find . -type d -exec sudo chmod 755 {} \; Please note that using chmod -R 755 will mark both directories and files as 755.

Export only pages and posts with mysql dump

This is generally not a good idea. See this WordPress database diagram. You need to consider: posts that have categories or tags (terms), their relationships, term meta, and taxonomies posts that have authors (users) posts that have comments things that are actually posts that you might not realise are posts (eg. almost everything in WordPress … Read more

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