Вход на сайт

Просмотр новости

Найдите то, что Вас интересует

Reply To: 4.0.0: table scan of wp_postmeta on every admin page load

Дата публикации: 13-10-2026 22:59:56



Thanks for getting back to us, this appears to have resolved the issue.



Основное содержимое страницы с новостью.

  • After updating to 4.0.0, wp-admin pages became very slow for administrators, and some requests hit our long page timeout. Rolling back to 3.10.0 fixed it. We have 3.3M+ rows in our wp_postmeta table.

    CAUSE

    includes/multi-authors/wpa-guest-authors-legacy.php, lines 8-37:

    function awpa_register_legacy_migration_menu() {
        if (!current_user_can('manage_options')) { return; }
        ...
        $orphaned_meta_count = (int) $wpdb->get_var(
            "SELECT COUNT(*) FROM {$wpdb->postmeta} WHERE meta_value LIKE '%guest-%'"
        );
        if ($guest_count > 0 || $orphaned_meta_count > 0) { add_submenu_page(...); }
    }
    add_action('admin_menu', 'awpa_register_legacy_migration_menu', 65);

    admin_menu fires on every wp-admin page load, so for every user with manage_options this query runs on every admin page.

    The result isn’t cached, and it’s only used to decide whether to show the “Migrate Guests” submenu.

    In the wp_postmeta table, the meta_value column is an unindexed longtext, and the leading % rules out any index and MySQL scans the whole table. I ran EXPLAIN on the query on our prod site and it did scan all 3367457 rows.

    I considered adding an index to solve this but that wouldn’t have helped because of the leading % rules out the index being used.

Схожие новости

#Наименование новостиТональностьИнформативностьДата публикации
1Reply To: So many issues!!!011.5913-10-2026
2Reply To: The font color settings issues5227-06-2026
3Reply To: remove admin email012.8409-08-2026
4Reply To: Conflict with new CF7 plugin update 6.2.2013.113-10-2026
5Reply To: Duplicate orders and checkout session timeouts since latest WooCommerce update016.913-10-2026
6Reply To: Great support7327-06-2026
7Reply To: Constant Contact Forms has experienced issues that may need addressed0102-07-2026
8Reply To: Astra 4.13.7 fatal: WP_Error::get_data() class-astra-elementor.php:388016.4109-08-2026
9New Wordpress Website - 500 Internal Server Error08.2220-09-2026
10Reply To: WPS Hide Login Has Completely Broken My WordPress 7.02302-07-2026

Классификация: . Схожих патентов: 0. Схожих новостей: 10. Тональность: 0. Информативность: 15.62. Источник: wordpress.org.