• Resolved diss0nance

    (@diss0nance)


    Hello… after updating today, one of my plugins stopped working (wpboxer) and now I want to search/replace all the post content that refer to that plugin and remove it….. problem is that I’m trying to search for content that has some French characters in it, and both phpmyadmin and the WP search/replace plugins I’ve tried, will not find it…. though in the database I can see it there, and try to search exactly for what I can see in the database, it still can’t find it:

    I have to remove this complete text from over 100 posts:

    <h2>Design d’intérieur / Interior Design</h2>
    [box set=”interiors”]
    <div style=”clear: both;”></div>
    <h2>Reproductions encadrées / Framed Prints</h2>
    [box set=”frames”]

    this is the query I’ve used in php….

    UPDATE wp_zkgn9p_posts SET post_content = REPLACE (
    post_content,
    ‘<h2>Design d’intérieur / Interior Design</h2>
    [box set=”interiors”]
    <div style=”clear: both;”></div>
    <h2>Reproductions encadrées / Framed Prints</h2>
    [box set=”frames”]’,
    ‘ ‘);

    which finds nothing, and tells me:

    #1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘intérieur / Interior Design</h2> [box set="interiors"] <div style="clear: bot’ at line 3

    I tried to understand the character encoding, and it’s way over my head…. can you help please?

    thank you,

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter diss0nance

    (@diss0nance)

    it’s not plugin related…. just saying.

    link to the site is here: http://www.jaxart.ca tho I’m not sure you can see the problem from there tho.

    Thread Starter diss0nance

    (@diss0nance)

    thanks for that awesome script…. but it didn’t work:

    result:

    In the process of replacing “Design d’intérieur / Interior Design [box set=”interiors-2″] Reproductions encadrées / Framed Prints [box set=”frames”]” with “Contact to order framed print or custom size digital printed fabric.” we scanned 1 tables with a total of 760 rows, 0 cells were changed and 0 db update performed and it all took 0.424768 seconds.

    I scanned the posts table… tried both with and without HTML tags.

    what would happen if I changed the character set for the post content in mysql to null or binary, do the search/replace, and then change it back to utf8 after?

    I’m no SQL expert so can’t answer the question about null vs binary.

    Did you try using that script to delete what you found in the DB record? So instead of entering the block that’s in your WP post or page, copy the stuff that’s stored in the DB record and see if the script will find it that way. The é character is probably being stored as ASCII or something.

    You could also try doing it section by section – try to get rid of the “Reproductions encadrées / Framed Prints” string first (using whatever is literally being stored in the DB, if it’s different). Then, if that works, use the script to do the other bits like the shortcodes separately. The reason I’m suggesting to do it in stages is that it’s also possible the quotation marks are getting in the way when you try to do the whole thing – I don’t know for sure, just a guess. If you chunk it out, then you can isolate where the problem is.

    And obviously you’ve taken a backup of your DB first before doing all this!! 🙂

    Thread Starter diss0nance

    (@diss0nance)

    Yep, that’s what I am doing now. I had to break it down into chunks….

    exported post content to CSV, copied the text from there to search, and find/replace it in chunks, not the whole thing at once.

    thanks again for that script, it is perfect.

    backup? what’s a backup? lol

    cheers

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

The topic ‘search and replace french characters’ is closed to new replies.