Category: PHP WordPress

WordPress SQL to replace hardcoded URLs in posts

UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'LINKTOFIND', 'LINKTOREPLACE'); UPDATE wp_options SET option_value = REPLACE(option_value, 'LINKTOFIND', 'LINKTOREPLACE'); UPDATE wp_posts SET `guid` = REPLACE(`guid`, 'LINKTOFIND', 'LINKTOREPLACE'); UPDATE wp_posts SET post_content = REPLACE(post_content, 'LINKTOFIND', 'LINKTOREPLACE'); UPDATE wp_contact_form_7 SET mail= REPLACE(mail, 'LINKTOFIND', 'LINKTOREPLACE'); UPDATE wp_contact_form_7 SET mail_2 = REPLACE(mail_2, 'LINKTOFIND', 'LINKTOREPLACE'); UPDATE wp_wp_super_edit_options SET value = REPLACE(value, 'LINKTOFIND', 'LINKTOREPLACE'); UPDATE wp_wp_super_edit_users SET editor_options = REPLACE(editor_options, 'LINKTOFIND', 'LINKTOREPLACE');



How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 1

No votes so far! Be the first to rate this post.