0

I run a wrong SQL query and now I have to fix some things from the beginning. In my wp_postmeta table there are two fields, meta_value and meta_key.

How can I replace the existing value of meta_key to _tdomf_custom_permalink on every row that the string http://www.domain.com/?h is found in meta_value using phpmyadmin SQL.

Secondly, how can I replace the http://www.domain.com/?h (in meta_value field) with another domain ?

Thank you.

1 Answer 1

2

Just use update statements in SQL:

update wp_postmeta 
set meta_key = '_tdomf_custom_permalink' 
where meta_value = 'http://www.domain.com/?h'

to then replace the http://www.domain.com/?h:

update wp_postmeta 
set meta_value = 'http://www.yourdomain.com/?h' 
where meta_value = 'http://www.domain.com/?h'
Sign up to request clarification or add additional context in comments.

1 Comment

have you tried not using % at the end of the searched string? Or if you are using %, did you change the query to use the LIKE keyword?

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.