How to search and replace text in all posts of a wordpress.com blog (NOT wordpress.org one)?

I have some texts that need to be replaced in every posts in my blog. Is it possible to do that?

ps
(I need to tag this question as search-and-replace but not enough reputation to do that. Please add the tag if you can. Thank you!)

2 Answers
2

You have at least three different ways:

1) Edit directly in the database. The content of the post is stored in post_content column of wp_posts table. Since you are running your own WordPress, you should have full access to that. Just use SQL to do search and replace. Remember, the table content is sort-of HTML, so may have tags and/or escaped characters

2) Export your blog into XML, do search/replace in any UNICODE ready editor and import it back in after deleting original content. I would practice this a couple of times first though, especially checking what happens with images, etc.

3) Use WordPress remote access API to iterate through posts and update them that way. Good for programmers and/or more flexible way of doing things, such as content-specific updates.

Leave a Comment