Answer the question
In order to leave comments, you need to log in
How to find and replace blocks of text (HTML code) in a MySQL database?
There is a shitty WordPress site with about ~900 pages. Some of them have an HTML form (right in the body of the page). You need to replace it with the shortcode of the Contact Forms 7 plugin.
A normal request like
UPDATE wp_posts
SET post_content = REPLACE(post_content, 'найти', 'заменить на')
WHERE post_content LIKE '%найти%';
Answer the question
In order to leave comments, you need to log in
1. sql - select all pages from database
2. php foreach is all
3. php -regular check for the presence of a form
4. php -regular to replace
5. sql - update record in database
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question