• 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)
Viewing 1 replies (of 1 total)
  • The topic ‘SQL query to process html tags ?’ is closed to new replies.