我设法根据正则表达式(适合每个标题的标题)来更新帖子类别-但是如何更新多个类别?想要在此代码中同时添加NY和USA标签...目前仅添加了一个类别(NY)
REPLACE INTO wp_term_relationships (term_taxonomy_id, object_id)
SELECT '169', ID
FROM `wp_posts`
WHERE (post_title REGEXP 'New York|N\\.Y\\.| ny|NYC|NewYork|Bronx|Brooklyn|Staten Island|Manhattan|Queens|Newark'
OR post_content REGEXP 'New York|N\\.Y\\.| ny|NYC|NewYork|Bronx|Brooklyn|Staten Island|Manhattan|Queens|Newark'
OR post_title COLLATE utf8mb4_bin REGEXP 'NY'
OR post_content COLLATE utf8mb4_bin REGEXP 'NY'
)
AND post_type = 'post'
可以使其仅添加一个类别。抱歉,我是新手(尽管我的正则表达式还可以)