普通网友 2014-10-21 08:42
浏览 33
已采纳

Wordpress自定义帖子类型列表页面大数据库

the custom post list page(where all posts are listed) is giving Maximum execution time of 60 seconds exceeded error,

Increasing time to an extent gived the same result i.e. maximum execution time reached or memory allocation error

I have

  1. No plugin activated,
  2. wordpress default theme activated for debugging purposes

    and still getting the same error

What I observed is for some reason wordpress is trying to show all custom posts(25,000 +) on the list page rather than showing 20 posts and than paginate the others, as no plugin is activated I am not sure what could be the reason behind this.

Is there any way I can observer what is causing this, I have added wp_debug to true in wp-config.php

Any help on this will be appreciated the custom post type have more than 25,000 posts

  • 写回答

1条回答 默认 最新

  • duanjia4220 2014-10-21 09:08
    关注

    This is explained in the WordPress Codex. Quite simply, this is a symptom of WordPress fetching all "hierarchical" posts, along with their meta data:

    Be careful, when choosing it for your custom post type - if you are planning to have many entries (say - over 100), you will run into memory issue. With this parameter set to true WordPress will fetch all entries of that particular post type, together with all meta data, on each administration page load for your post type.

    The problem comes from the fact that, in order to display pages and their hierarchy, WP has to load all of them and then build the tree in memory.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器