Support » Plugin: Pods - Custom Content Types and Fields » Slow load due to the legacy custom fields metabox

  • Resolved Jay Collier

    (@jcollier)


    We were consistently having a slow query on edit screens and the component reported was Core.

    SELECT DISTINCT meta_key 
    FROM wp_postmeta 
    WHERE meta_key NOT BETWEEN '_'
    AND '_z' 
    HAVING meta_key NOT LIKE '\\_%' 
    ORDER BY meta_key 
    LIMIT 30
    do_meta_boxes()
    wp-admin/includes/template.php:1304
    post_custom_meta_box()
    wp-admin/includes/meta-boxes.php:734
    meta_form()
    wp-admin/includes/template.php:678

    John Blackbourn (@johnbillion) from Query Monitor pointed out an ongoing problem with meta_form() and postmeta:

    “meta_form() is indeed a slow function when you have a large number of entries in the postmeta table. Core ticket: https://core.trac.wordpress.org/ticket/33885

    That was the pointer we needed. The thread pointed out legacy problems with the custom fields metabox. After dozens of entries, a link near the bottom of the thread worked perfectly for us:

    https://9seeds.com/wordpress-admin-post-editor-performance/

    After adding this function, our entire editor screen load time did go down from 1.5 seconds to .4 seconds.

    So here are my questions. Is it correct that Pods stores entries in the postmeta table? If so, since Pods has its own metabox display in the editor, does the above solution make sense?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jim True

    (@jimtrue)

    There is absolutely no reason to use the Custom Fields from WP Core metabox when we generate our own Metabox (which almost all custom fields plugins do, ACF included).

    All your code solution does it make that particular item unavailable. You could do the same thing by just turning it off in Screen Options.

    Good points. Since we will have dozens of one-post authors, I’m happy to turn it off universally, rather than ask each to change screen options.

    Plugin Author Jim True

    (@jimtrue)

    Typically, when I’ve done those, I set it as admin when I first visit that page and that is reflected on the users that come in later. Also if it’s not ‘supported’ it shouldn’t show it, but that might be a problem with WP Core.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.