WordPress.org

Ready to get started?Download WordPress

Forums

Editing html code (5 posts)

  1. ledatechie
    Member
    Posted 7 years ago #

    What is the easiest way to edit the html code for a bunch of WP posts? I would like to remove the "rel=lightbox[pics33]" type code from several dozen blog entries.

    Is there a way I can access the raw html so I can use a search tool and edit this information?

    Is this a good idea? Thanks.

  2. The content of your posts lives in the database, you you can't actually edit the generated HTML.

    You can try the Search and Replace plugin, which will let you make changes to the database.

    Make sure you have a good backup first, and handle with care - there is no "undo" if you make a mistake with your edits.

    And make sure you have a backup of your database first (yes I know I said that twice!)

  3. ledatechie
    Member
    Posted 7 years ago #

    Thanks I'll check out the plugin.

    I wonder if you could export the SQL from the proper MySQL table, then run a search and replace operation on the data, then upload it back to the database?

    I wouldn't know where to start, and this would be for the future. Seems this would be safer as you could verify your changes prior to uploading the changed table data back.

  4. ledatechie
    Member
    Posted 7 years ago #

    I looked at the plugin, and, well, I'm not sure I trust it.

    I had success using an approach that wasn't suggested here. I exported the database to an SQL file, then ran a search & replace utility to replace the code. I then imported the SQL back into the database after dropping the MySQL tables.

    The nice thing was that I could see the proposed changes to the SQL prior to committing. This is a feature of the utility I used (Funduc Search & Replace).

  5. Jonathan Landrum
    Member
    Posted 7 years ago #

    That's exactly what I was going to suggest.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags