首页 > 代码

批量删除wordpress所有内容页里某个字符段前后的内容

举个栗子一:
批量删除某个内容前的所有内容 例:删除表wp_posts 字段post_content 内容里所有href前的内容


update wp_posts set post_content = substr(post_content,locate('href',post_content)) where post_content is not null and locate('href',post_content)>=1

举个栗子二:

批量删除某个内容后面的所有内容 例:删除表wp_posts 字段post_content 内容里所有.pdf后的内容


update wp_posts set post_content = LEFT(post_content,  INSTR(post_content, '.pdf') - 1) where post_content like '%.pdf%';


  • 彻底删除wordpress里的global-styles-inline-css
  • <style id='global-styles-inline-css' type= […]

  • 服务器上mysql数据库很多,某个库把整台服务器拉爆了,如何定位找到罪魁?
  • 服务器上mysql数据库很多,某个数据库把整台服务器拉爆了,如何定位找到罪魁? 先在 MySQL 里把“正在烧 […]

  • 批量设置wordpress文章分类,把文章 ID 区间为 1256869 到 1257421批量设置分类为 ID =5
  • 将 cuwen.wp_posts 中 文章 ID 区间为 1256869 到 1257421(含) 的文章批量 […]

  • 同一台服务器里的两个wordpress数据库文章内容叠加复制
  • 问题:同一台服务器里的两个wordpress数据库,我要把名为temp数据库里的wp_posts的所有文章 全 […]

  • WordPress 如何在首页与内页用不同的菜单或header
  • 开发wordpress主题时,首页的header内容与内页的header内容希望不一样,这时就要用到WordP […]

  • wordpress有必要在body内加<body <?php body_class(); ?>吗?
  • 是 WordPress 主题开发中非常有用的一部分,建议保留。它会自动输出一些根据页面类型、用户状态、文章分类 […]