如果需要,可以直接在mysql中执行此操作。(我们的woocommerce网站上有成千上万的产品):
update wp_posts set post_name = concat(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(lower(post_title), \'"\', \'\'), "\'", \'\'), ",", \'-\'), " ", \'-\'), "&", \'\'), ";", \'\'), "@", \'\'), ".", \'\'), ":", \'\'), "/", \'\'), "+", \'\'), "(", \'\'), ")", \'\'), "--", \'-\'), "---", \'-\'), "--", \'-\'), "--", \'-\'), \'-\', id) where post_type = \'product\';
其中post\\u type=“product”-这将使您只更新woocommerce产品;您应该弄清楚要对此查询保持什么限制。