Title: MySQL WordPress Database query help needed
Last modified: August 19, 2016

---

# MySQL WordPress Database query help needed

 *  Resolved [JaneLitte](https://wordpress.org/support/users/janelitte/)
 * (@janelitte)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/mysql-wordpress-database-query-help-needed/)
 * I am not sure if anyone here can help me, but I want to do a search and replace
   in my database. There is a word that is used in certain post titles that I want
   removed.
 * This is the query I have devised, but I am not getting the end of the query correct:
 * `UPDATE`wp_posts`SET post_title = replace( post_title, 'REVIEW:', '' ) FROM`wp_terms`
   WHERE`term_id`=9 LIMIT 0`
 * I want to search the database for all posts with the term (formerly category)
   = 9.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/mysql-wordpress-database-query-help-needed/#post-675291)
 * This should do:
 *     ```
       UPDATE wp_posts AS p
       INNER JOIN wp_term_relationships AS tr ON p.ID=tr.object_id
       INNER JOIN wp_term_taxonomy AS tt ON tr.term_taxonomy_id=tt.term_taxonomy_id
       SET post_title = replace( post_title, 'REVIEW:', '' ) WHERE tt.term_id=9;
       ```
   
 * Make a back up of your database first. Always a good idea before manually modifying
   it.
 *  Thread Starter [JaneLitte](https://wordpress.org/support/users/janelitte/)
 * (@janelitte)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/mysql-wordpress-database-query-help-needed/#post-675314)
 * Thank you very much. This worked perfect.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘MySQL WordPress Database query help needed’ is closed to new replies.

## Tags

 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [JaneLitte](https://wordpress.org/support/users/janelitte/)
 * Last activity: [18 years, 5 months ago](https://wordpress.org/support/topic/mysql-wordpress-database-query-help-needed/#post-675314)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
