Set no_found_rows in WordPress to disable the use of SQL_CALC_FOUND_ROWS to calculate totals to optimize post listing page open speeds

Posted in:
Update time:2024-01-29

We offer WordPress Themes and Plugins Custom Development Services

This site has long undertaken WordPress themes, plugins, WooCommerce-based store mall development business. We have 10 years of experience in WordPress development, if you want to Developing Websites with WordPress, please contact WeChat: iwillhappy1314 or email: amos@wpcio.com for inquiries.

8 thoughts on “在 WordPress 中设置 no_found_rows 禁止使用 SQL_CALC_FOUND_ROWS 计算总数,以优化文章列表页打开速度

    1. 感谢提醒!其实在 WordPress 中,action 执行的还是 filter 的操作,和 filter 不同的是 action 没有返回值,所以可以用 add_filter 代替 add_action 使用。

      不过从代码的严谨性考虑,你的提醒是对的。

      1. 是的底层都是global $wp_filter;,我就是看你这个filter函数没有返回值,所以产生了怀疑。哈哈。

发表回复

Your email address will not be published. 必填项已用 * 标注

*