Title: SQL query to process html tags ?
Last modified: August 19, 2016

---

# SQL query to process html tags ?

 *  [sabinou](https://wordpress.org/support/users/sabinou/)
 * (@sabinou)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/sql-query-to-process-html-tags/)
 * Hello,
 * I’ve used for a very long time an sql query provided by the blogger Lorelle, 
   to search and replace strings of texts in the contents of my posts.
 * Here’s the script :
 *     ```
       UPDATE wp_posts SET post_content = REPLACE (
       post_content,
       'text to replace',
       'text taking place of the previous text');
       ```
   
 * However, when trying to replace
    `'(<strong>text</strong>, more text ? more text,
   <strong>more text</strong> ! :) )</p></blockquote> ',` with `'[sc name="shortcode1"]
   </p></blockquote>');`
 * It didn’t work. Phpmyadmin found 0 matches (there should have been around 300).
 * I suppose something in the html tags broke the mysql query, but sadly, I’m not
   competent enough to find WHAT it might be.
 * A solution would be to export my wp_posts table and process it with a text file
   editor on my hard disks, and then reupload it, but this would be a long operation(
   compressed, my wp_posts is 6 MB large) and previous similar operations sometimes
   generated encoding issues with accentuated characters.
    – I’d rather keep it 
   inside phpmyadmin.
 * I’m asking “just in case”, perhaps the solution will be obvious for someone else…
   
   Please, would you know if there’s a solution to manage to process the html tags
   in a mysql query ?
 * Thank you very much if you can help me, I’ll be grateful 🙂
    Sabinou

Viewing 1 replies (of 1 total)

 *  Thread Starter [sabinou](https://wordpress.org/support/users/sabinou/)
 * (@sabinou)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/sql-query-to-process-html-tags/#post-1982396)
 * I allow myself a free bump 🙂

Viewing 1 replies (of 1 total)

The topic ‘SQL query to process html tags ?’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [sabinou](https://wordpress.org/support/users/sabinou/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/sql-query-to-process-html-tags/#post-1982396)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
