# Mass replace in WordPress posts via MySQL query

DevFeed: [Mass replace in WordPress posts via MySQL query](<https://devfeed.tech/articles/mass-replace-in-wordpress-posts-via-mysql-query-27645.md>)

Original publisher: [Read original article](<https://gagor.pro/2016/02/mass-replace-in-wordpress-posts-via-mysql-query/>)

Author: Tom

Published: 2016-02-09T00:00:00Z

Content type: tutorial

Language: en

Sources: [Tomasz Gągor](<https://devfeed.tech/sources/tomasz-gagor.md>)

Topics: [WordPress](<https://devfeed.tech/topics/wordpress.md>), [MySQL](<https://devfeed.tech/topics/mysql.md>), [SQL](<https://devfeed.tech/topics/sql.md>)

Tags: [backup](<https://devfeed.tech/tags/backup.md>), [https](<https://devfeed.tech/tags/https.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [sql](<https://devfeed.tech/tags/sql.md>), [wordpress](<https://devfeed.tech/tags/wordpress.md>)

## AI overview

A tutorial showing how to use a MySQL SQL query to replace text in WordPress posts, including updating URLs to HTTPS. It advises backing up the database before making changes.

## Source excerpt

I was doing a lot of changes to my old posts, switched to HTTPS, etc. Sometimes it was useful to change some particular text in all my old posts at a time, but there is no such feature in WordPress. But WordPress runs on MySQL and I could use SQL query to update such posts. Make backup - it's not required but strongly advised 😃 Now use this query as template to replace in place whatever you need: UPDATE wp_posts SET post_content = REPLACE(post_content, " ", ""); You should see something like: