Support » Fixing WordPress » searching the source

  • Does anyone have any idea on how to search the content source? let’s say you need to find and replace a given tag in all your posts and pages, how do you do that?

    By the way, I tried to search the word “search” in this forum and….
    Tatatata! The result is really funny. 🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • “Tatatata!”

    You said wanted to search the “source,” didn’t ya? ;)

    To do what you want would require going direct to the database. If you access yours using a tool like phpMyAdmin, the interface makes it fairly easy to search a specific field in a table. Search and replace is a little more complicated, though. For example, when I swapped out <br> for <br /> in my older posts, I used this SQL query statement:

    UPDATE wp_posts SET post_content = REPLACE(post_content, '<br>', '<br />');

    The MySQL resource page on REPLACE:

    EDIT: Forgot to note that it’s always a smart move to backup (i.e. export) your database before making any sort of changes to it. Better safe than…you know.

    What I’m looking for is something practical, even easy to revert and without dealing with MySQL.

    Mark (podz)


    Support Maven

    The only other way is to export your database, open the file in a decent editor, run a search/replace the import the result.

    … need to find and replace a given tag…
    It might also depend on what kind of tag?

    Actually need to replace a

    <br clear=”left” />
    and a
    ” />-
    ” align=”left” hspace=”5″/>-
    ignoring spaces.

    Will try the procedure suggested by Podz. Hopping for the best and planning for the worse.

    Just remember whatever way you go, you’ll be dealing with MySQL to one degree or another. Really no way around it (if you know what I mean).

    Wow…what does happen when you search for ‘search’ – why do I get a css file?



    If our passwords were hiding in that file, I’d agree. But you’re just dropped into a css file. Hardly a breach, but definitely a bug.

    “Just remember whatever way you go, you’ll be dealing with MySQL ”

    I did test both methods. Whew! No problem, but it was just a test. Will wait until weekend to fight that battle. Still I wish some sort of coded source search.


    I thought it was an Easter egg 😉 Where is my prize?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘searching the source’ is closed to new replies.