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 might also try this plugin: http://wordpress.org/plugins/batchmove/
Related Posts:
- How Do I Delete WordPress Posts Older Than 400 Days, From A WordPress Category
- Custom Query to search through categories
- Disallow categories from this MySQL query
- Accessing WordPress MySQL Database via Data Connection in Visual Studio 2010 using C#
- How to get related tags based on a category?
- How to list all categories and their IDs using SQL query?
- how to get postmeta info based on multiple categories?
- How to create a foreign key in phpmyadmin
- importing a CSV into phpmyadmin
- How To Find Out WordPress Category Table in MYSQL?
- is_category() in pre_get_posts strange error
- Rearranging posts based on categories
- How to convert regular categories to custom taxonomy?
- How to query all posts of a specific category, and any other category combination
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- Query the Loop without breaking it
- How to Check if a Child Category is Being Queried
- Delete all post meta except featured image
- Deleting All tags except categories Wp database
- WooCommerce – Query for ordered products
- How to find if a post with custom_field == X exists?
- WP database error for comments_popup_link()
- Delete duplicate rows from wordpress database where a column is duplicate in phpmyadmin
- Query WordPress database by registered date and role
- Set Display Name to first and last name (phpmyadmin SQL Query)
- Emojis getting converted to “?”
- Category archive page – loop through posts of certain tag (with pagination) – pre_get_posts
- Is it good practice to use wpdb->query() function?
- If newest post of category is newest post in general, skip first post of category
- Select Multiple meta_value from WP DB; Single Query
- Delete all post meta except featured image Using SQL
- Update slug (URL) of pending posts via phpMyAdmin
- CRUD operations using WordPress database API
- How to display posts under a specific subcategory of a given category
- get_the_category and echo out link to child-most/deepest category
- Change the category of all posts in it
- How to run select query of post with category and tags for API?
- query in category.php repeats itself
- Display posts separated by Category in Author’s page
- Slow queries constantly getting stuck on WordPress database of ~100,000 posts
- Category param redirect to post type archive
- How to get latest posts from each category in regular order
- category pagination got broken suddenly
- Better ads plugin has 500.000 entries in wp_postmeta
- How to query categories with Advanced Custom Fields?
- Where and when does WordPress invoke routes
- Can Categories be used to hack a Multisite-like setup w/ a single MySql db?
- Wacky taxonomy in wordpress
- Query multiple tables at once?
- Changing root password in PHPMyAdmin for WordPress Database when going live
- Can’t update WordFence Options, clear data manually
- Custom WordPress Table wpdb
- Best practice to limit results in get_row()?
- Exclude category from query
- Array: What is this value based on?
- Overriding default calendar to show posts from a category
- Always get creating a new table with foreign key
- SQL query to set posts in bulk based on the post content
- Query Column of Specific ID from Database Table
- function query_posts disabling current_page_menu class
- Files on Localhost, Database on Server
- Deleting a category from WordPress admin does it remove it completely from the database?
- custom query for both category and pages using global $wpdb;
- Query from multiple category (and)
- How to display posts from specific category using get_option function?
- WordPress: Using the category slug get the category ID using mysql query
- How to add categories using mysql
- SQL error with custom query
- How to filter post from categories only if the posts appears in one of them, not the other?
- Show Posts via cat+cat in URL that are in both Categories doesn’t work
- DB prefix not updating
- I wanted to Know that how can I give ingore to 0000-00-00 in my config file
- Deleted products from woocommerce are still in the database
- Create categories manually in database
- Store GravityForm data in phpmyadmin (mysql)
- How do I merge WooCommerce categories with the same name?
- Get category from slug list
- Search Replace Database ONLY for posts of certain category?
- Issue with WordPress category search
- Querying posts from two different categories while looping inside another loop
- Missing latest posts and options after DB migration via phpMyAdmin
- Too many categories drastically slow down my website
- How to get posts from many categories using WP_Query
- Get category fixed in dropdown browse categories
- WP_Query always returning the last custom post
- Check if a database is well installed
- Is it possible to query the result of a query?
- show posts found in multiple categories via category_name query string?
- Backend – Categories and Menus conflicts
- Category slug in in loop always the same?
- display certain category on custom template page
- Detecting top parent category fails on home page
- How to use Greek characters/letters in a query?
- Displaying posts by year
- wordpress category.php query for featured news item, broken pagination and repeating posts
- finding out the top 5 source ( source is a custom taxonomy ), in a given category
- add an image field to wordpress category
- How to show posts of a specific category
- Fetch all categories from database
- SQL Query to get post_id from wp_posts and and meta_key(s) from wp_postmeta