MySQL数据库使用replace方法去除字段中的换行符/回车/空格 2021年4月23日

wordpress 去除换行符,空格等

去换行符

update wp_posts set post_content = replace(post_content, char(13), '');

去回车符

update wp_posts set post_content = replace(post_content, char(10), '');

去空格符

update wp_posts set post_content = replace(post_content, char(13), '');

一起去掉换行符/回车/空格

update wp_posts set post_content = replace(replace(replace(post_content , char(10), ''),char(13), ''), char(9), '');
 

共有 1 条评论

  1. 跨境电商卖家

    啥也不说了,就是给力!

You must be logged in to post a comment.