1

If I run this query I get back several rows:

SELECT * FROM `wp_posts` where `post_content` like '%http://www.youtube%'

However when I run the query below, it says 0 rows effected.

UPDATE `wp_posts`
SET `post_content` = REPLACE(`post_content`,'%http://www.youtube%','%https://www.youtube%')
WHERE `post_content` like '%http://www.youtube%'

I am using PhpMyAdmin hosted on WP Engine. Their support say there is no restrictions on updating multiple rows.

What is wrong with the query?

1 Answer 1

2

Lose the % inside the replace:

UPDATE `wp_posts`
SET `post_content` = REPLACE(`post_content`,'http://www.youtube','https://www.youtube')
WHERE `post_content` like '%http://www.youtube%'
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. So obvious yet I didn't see it. I'll accept soon as timer runs out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.