• Resolved ImageMike Meinz

    (@mikemeinz)


    Seeing this SQL syntax error in the error_log occasionally. It looks like both an INNER JOIN and a LEFT JOIN use wp_postmeta without an alias.

    [12-Sep-2025 14:33:54 UTC] WordPress database error Not unique table/alias: 'wp_postmeta' for query SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.ID
    FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) LEFT JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id LEFT JOIN wp_term_relationships AS trel ON (wp_posts.ID = trel.object_id) LEFT JOIN wp_term_taxonomy AS ttax ON (( ttax.taxonomy = 'ml-slider' ) AND trel.term_taxonomy_id = ttax.term_taxonomy_id) LEFT JOIN wp_terms AS tter ON (ttax.term_id = tter.term_id)
    WHERE 1=1 AND wp_posts.post_type = 'attachment' AND (wp_posts.post_status = 'inherit' OR wp_posts.post_status = 'private') AND ( (wp_posts.ID LIKE '%transfer station%') OR (wp_posts.post_title LIKE '%transfer station%') OR (wp_posts.guid LIKE '%transfer station%') OR (wp_posts.post_content LIKE '%transfer station%') OR (wp_posts.post_excerpt LIKE '%transfer station%') OR (wp_postmeta.meta_key = '_wp_attachment_image_alt' AND wp_postmeta.meta_value LIKE '%transfer station%') OR (wp_postmeta.meta_key = '_wp_attached_file' AND wp_postmeta.meta_value LIKE '%transfer station%') OR (tter.slug LIKE '%transfer station%') OR (ttax.description LIKE '%transfer station%') OR (tter.name LIKE '%transfer station%') )
    GROUP BY wp_posts.ID
    ORDER BY wp_posts.post_date DESC
    LIMIT 0, 100 made by require_once('wp-admin/admin-header.php'), do_action('admin_enqueue_scripts'), WP_Hook->do_action, WP_Hook->apply_filters, PublishPress\Future\Modules\Workflows\Controllers\FutureLegacyAction->enqueueScriptsLegacyAction, PublishPress\Future\Modules\Workflows\Models\WorkflowsModel->getPublishedWorkflowsWithLegacyTriggerAsOptions, PublishPress\Future\Modules\Workflows\Models\WorkflowsModel->getPublishedWorkflowsWithMetadataAsOptions, WP_Query->__construct, WP_Query->query, WP_Query->get_posts


    [12-Sep-2025 14:34:05 UTC] WordPress database error Not unique table/alias: 'wp_postmeta' for query SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.ID
    FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) LEFT JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id LEFT JOIN wp_term_relationships AS trel ON (wp_posts.ID = trel.object_id) LEFT JOIN wp_term_taxonomy AS ttax ON (( ttax.taxonomy = 'ml-slider' ) AND trel.term_taxonomy_id = ttax.term_taxonomy_id) LEFT JOIN wp_terms AS tter ON (ttax.term_id = tter.term_id)
    WHERE 1=1 AND wp_posts.post_type = 'attachment' AND (wp_posts.post_status = 'inherit' OR wp_posts.post_status = 'private') AND ( (wp_posts.ID LIKE '%transfer station%') OR (wp_posts.post_title LIKE '%transfer station%') OR (wp_posts.guid LIKE '%transfer station%') OR (wp_posts.post_content LIKE '%transfer station%') OR (wp_posts.post_excerpt LIKE '%transfer station%') OR (wp_postmeta.meta_key = '_wp_attachment_image_alt' AND wp_postmeta.meta_value LIKE '%transfer station%') OR (wp_postmeta.meta_key = '_wp_attached_file' AND wp_postmeta.meta_value LIKE '%transfer station%') OR (tter.slug LIKE '%transfer station%') OR (ttax.description LIKE '%transfer station%') OR (tter.name LIKE '%transfer station%') )
    GROUP BY wp_posts.ID
    ORDER BY wp_posts.post_date DESC
    LIMIT 0, 100 made by require_once('wp-admin/admin-header.php'), do_action('admin_enqueue_scripts'), WP_Hook->do_action, WP_Hook->apply_filters, PublishPress\Future\Modules\Workflows\Controllers\FutureLegacyAction->enqueueScriptsLegacyAction, PublishPress\Future\Modules\Workflows\Models\WorkflowsModel->getPublishedWorkflowsWithLegacyTriggerAsOptions, PublishPress\Future\Modules\Workflows\Models\WorkflowsModel->getPublishedWorkflowsWithMetadataAsOptions, WP_Query->__construct, WP_Query->query, WP_Query->get_posts

    [12-Sep-2025 14:34:11 UTC] WordPress database error Not unique table/alias: 'wp_postmeta' for query SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.ID
    FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) LEFT JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id LEFT JOIN wp_term_relationships AS trel ON (wp_posts.ID = trel.object_id) LEFT JOIN wp_term_taxonomy AS ttax ON (( ttax.taxonomy = 'ml-slider' ) AND trel.term_taxonomy_id = ttax.term_taxonomy_id) LEFT JOIN wp_terms AS tter ON (ttax.term_id = tter.term_id)
    WHERE 1=1 AND wp_posts.post_type = 'attachment' AND (wp_posts.post_status = 'inherit' OR wp_posts.post_status = 'private') AND ( (wp_posts.ID LIKE '%transfer station%') OR (wp_posts.post_title LIKE '%transfer station%') OR (wp_posts.guid LIKE '%transfer station%') OR (wp_posts.post_content LIKE '%transfer station%') OR (wp_posts.post_excerpt LIKE '%transfer station%') OR (wp_postmeta.meta_key = '_wp_attachment_image_alt' AND wp_postmeta.meta_value LIKE '%transfer station%') OR (wp_postmeta.meta_key = '_wp_attached_file' AND wp_postmeta.meta_value LIKE '%transfer station%') OR (tter.slug LIKE '%transfer station%') OR (ttax.description LIKE '%transfer station%') OR (tter.name LIKE '%transfer station%') )
    GROUP BY wp_posts.ID
    ORDER BY wp_posts.post_date DESC
    LIMIT 0, 100 made by require_once('wp-admin/admin-header.php'), do_action('admin_enqueue_scripts'), WP_Hook->do_action, WP_Hook->apply_filters, PublishPress\Future\Modules\Workflows\Controllers\FutureLegacyAction->enqueueScriptsLegacyAction, PublishPress\Future\Modules\Workflows\Models\WorkflowsModel->getPublishedWorkflowsWithLegacyTriggerAsOptions, PublishPress\Future\Modules\Workflows\Models\WorkflowsModel->getPublishedWorkflowsWithMetadataAsOptions, WP_Query->__construct, WP_Query->query, WP_Query->get_posts

    [12-Sep-2025 14:34:26 UTC] WordPress database error Not unique table/alias: 'wp_postmeta' for query SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.ID
    FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) LEFT JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id LEFT JOIN wp_term_relationships AS trel ON (wp_posts.ID = trel.object_id) LEFT JOIN wp_term_taxonomy AS ttax ON (( ttax.taxonomy = 'ml-slider' ) AND trel.term_taxonomy_id = ttax.term_taxonomy_id) LEFT JOIN wp_terms AS tter ON (ttax.term_id = tter.term_id)
    WHERE 1=1 AND wp_posts.post_type = 'attachment' AND (wp_posts.post_status = 'inherit' OR wp_posts.post_status = 'private') AND ( (wp_posts.ID LIKE '%transfer station%') OR (wp_posts.post_title LIKE '%transfer station%') OR (wp_posts.guid LIKE '%transfer station%') OR (wp_posts.post_content LIKE '%transfer station%') OR (wp_posts.post_excerpt LIKE '%transfer station%') OR (wp_postmeta.meta_key = '_wp_attachment_image_alt' AND wp_postmeta.meta_value LIKE '%transfer station%') OR (wp_postmeta.meta_key = '_wp_attached_file' AND wp_postmeta.meta_value LIKE '%transfer station%') OR (tter.slug LIKE '%transfer station%') OR (ttax.description LIKE '%transfer station%') OR (tter.name LIKE '%transfer station%') )
    GROUP BY wp_posts.ID
    ORDER BY wp_posts.post_date DESC
    LIMIT 0, 100 made by require_once('wp-admin/admin-header.php'), do_action('admin_enqueue_scripts'), WP_Hook->do_action, WP_Hook->apply_filters, PublishPress\Future\Modules\Workflows\Controllers\FutureLegacyAction->enqueueScriptsLegacyAction, PublishPress\Future\Modules\Workflows\Models\WorkflowsModel->getPublishedWorkflowsWithLegacyTriggerAsOptions, PublishPress\Future\Modules\Workflows\Models\WorkflowsModel->getPublishedWorkflowsWithMetadataAsOptions, WP_Query->__construct, WP_Query->query, WP_Query->get_posts
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Imageandergmartins

    (@andergmartins)

    Hi @mikemeinz thank you for getting in touch.

    Please, could you let us know the list of plugins you have installed on your site? It seems like this is due to a conflict with a 3rd party plugin. I see Metaslider is probably installed, but I don’t think that is the plugin causing the conflict.

    Thread Starter ImageMike Meinz

    (@mikemeinz)

    Plugins:
    Admin Safety Guard
    Advanced Custom Fields PRO
    Attachments
    Auto iFrame
    Broken Link Checker (Local)
    Classic Editor
    Classic Widgets
    Contact Form 7
    Contact Form 7 Apps
    Disable Emojis (GDPR friendly)
    Disable REST API
    Disable XML-RPC
    Enhanced Text Widget
    List category posts
    Max Mega Menu
    Media Search Enhanced
    MetaSlider
    MetaSlider Pro
    My Calendar - Accessible Event Manager
    Password Protection Expiration
    PublishPress Future
    Relevanssi
    WP Activity Log
    Yoast SEO
    Thread Starter ImageMike Meinz

    (@mikemeinz)

    I just checked the wp-admin error_log. Today is 09/20. The reported SQL syntax errors were logged on 09/12. I thought you should be aware that SQL syntax error has not been repeated at this time.

    Plugin Author ImageSteve Burge

    (@stevejburge)

    OK, thanks @mikemeinz. We’ve not had any luck re-creating this error either.

    Let’s come back to this issue if either of us find out more details.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.