• Resolved Mayank Majeji

    (@mayankmajeji)


    Hello!

    My WordPress search is not working properly and it seems TablePress is the culprit. I did cross-check by deactivating TablePress and search started working fine.

    When I turned on WP_DEBUG, it threw this error.

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘]?)(18)([\]”\’ /])’))) AND (wpdemo_posts.post_password = ”) AND wpdemo_post’ at line 1]
    SELECT SQL_CALC_FOUND_ROWS wpdemo_posts.ID FROM wpdemo_posts WHERE 1=1 AND (((wpdemo_posts.post_title LIKE ‘%keyword%’) OR (wpdemo_posts.post_excerpt LIKE ‘%keyword%’) OR (wpdemo_posts.post_content LIKE ‘%keyword%’) OR (wpdemo_posts.post_content REGEXP ‘\\[table id=([“\’]?)(18)([\]”\’ /])’))) AND (wpdemo_posts.post_password = ”) AND wpdemo_posts.post_type IN (‘post’) AND (wpdemo_posts.post_status = ‘publish’) ORDER BY wpdemo_posts.post_title LIKE ‘%keyword%’ DESC, wpdemo_posts.post_date DESC LIMIT 0, 5

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    I’m not sure what exactly is causing this on your site. To hopefully get rid of the error, please try adding

    add_filter( 'tablepress_wp_search_integration', '__return_false' );
    

    to your theme’s “functions.php” file. This will turn off TablePress’ search integration.

    Regards,
    Tobias

    Thread Starter Mayank Majeji

    (@mayankmajeji)

    Thanks a lot, Tobias!

    It worked like a charm.

    But I hope I am not missing any serious functionality by excluding TablePress from WordPress search.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no, the only turned off feature is that tables won’t be searched if someone uses the normal WordPress search.

    Regards,
    Tobias

    Thread Starter Mayank Majeji

    (@mayankmajeji)

    Okay!

    Thanks a lot, mate.

    Have a nice day.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem! Always happy to help!

    Best wishes,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WordPress Database Table Error’ is closed to new replies.