• Resolved dmccan

    (@dmccan)


    For my plugin / CPT I would like to allow the user to order the articles like they can for pages. There is an option when registering a post type to indicate that it should support ‘hierarchical’ ordering of articles, like Pages do. However, there is a warning on the register_post_type codex page in relation to setting hierarchical to true:

    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.

    https://codex.wordpress.org/Function_Reference/register_post_type#hierarchical

    I can easily imagine users of my plugin having more than 100 articles. Is this still valid? I see in Trac this ticket as fixed:

    Need Better Page Hierarchy Display Algorithm:
    https://core.trac.wordpress.org/ticket/15459

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    There will always be some upper limit, but it’s now on the order of thousands, not hundreds. The limiting factor is now long load times. Users with 4-5k pages reported a 5x improvement in memory use and 3x improvement in load times. After their reports the patch was further improved, but no other quantitative performance improvements have been posted.

    I’m guessing 2-3k is now a more reasonable limit, I’m going to update that Codex note accordingly.

    Thank you for digging into this and posting to let us know!

    Thread Starter dmccan

    (@dmccan)

    Thanks for the info. I held off enabling this option because I didn’t want people’s sites to have slow performance, but now it seems safe to go ahead.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘CPT hierarchy – is there a limit on the number of articles?’ is closed to new replies.