Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pandanote-info/8dab67cf01a047a6203c2d9bfb043f67 to your computer and use it in GitHub Desktop.
Save pandanote-info/8dab67cf01a047a6203c2d9bfb043f67 to your computer and use it in GitHub Desktop.
WordPressに記事として書かれている文章のうち、設定ファイル、プログラム例、コマンドの出力結果及びWordpressの拡張タグなどを除いた部分のおおよその総文字数を求めるSQL文
-- WordPressに記事として書かれている文章のおおよその総文字数を求めるSQL文
-- なお、本SQL文を利用することにより得られた結果については責任は負いかねます。
select sum(char_length(regexp_replace(regexp_replace(regexp_replace(regexp_replace(post_content,'<.+?>',''),'\[.+?\]',''),'&.+?;','_'),'(\s+|\r\n|\n)','')))
as total from wp_posts where post_status = 'publish' and post_type = 'post';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment