Skip to content

Database error Unknown column ‘wp_posts.post_type’ in ‘WHERE’ clause #2888

@Buttsie

Description

@Buttsie

When WP Job Manager Applications is active, I consistently receive the following error (in my server logs) across various wp-admin pages (including unrelated ones)/

WordPress database error Unknown column ‘wp_posts.post_type’ in ‘WHERE’ clause

The SQL that triggers the error includes:

AND wp_posts.post_type NOT IN (‘job_application’)

However, the posts table in this query is already aliased as:

LEFT JOIN wp_posts AS wp_posts_to_exclude_reviews ON comment_post_ID= wp_posts_to_exclude_reviews.ID

So the clause should instead use:

AND wp_posts_to_exclude_reviews.post_type NOT IN (‘job_application’)

This appears to happen when the plugin filters wp_count_comments. Disabling either WP Job Manager Applications or WooCommerce resolves the issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions