dte29947 2014-12-16 15:56
浏览 59

Wordpress SQL查询来搜索和替换字符串

I'm trying to replace the following string in my Wordpress database:

[wpai_google_translate_text({./@name},{description[1]/short[1]},"en")]

I tried the 'https://wordpress.org/plugins/search-and-replace/' plugin but it wasn't able to handle the above string.

I also tried some of the other solutions on Google such as the following command in phpmyadmin:

SELECT * FROM wp_posts WHERE (post_content LIKE '%TEXT-TO-FIND-GOES-HERE%');

But that just searches from post contents.

The text I'm trying to replace doesn't reside in a post or page or any sort of user generated content.

So my question is, how can I search across my entire database and for that string and replace it with something else?

Thanks

  • 写回答

2条回答 默认 最新

  • dongyi1921 2014-12-16 16:03
    关注

    Close but you have the wrong query. Try:

    UPDATE wp_posts SET post_content = valueForField WHERE post_content LIKE '%TEXT-TO-FIND-GOES-HERE%';

    评论

报告相同问题?