• Resolved matthewmorete

    (@matthewmorete)


    Hi,

    I’m using ACF Better Search and it works great.
    My client has asked me not factor in ‘post_content’ when searching for results.
    This is pretty easily accomplished in wordpress with:

    add_filter('post_search_columns', function($search_columns) {
    // default ['post_title', 'post_content', 'post_excerpt']
    return ['post_title'];
    });

    However this seems to be overwritten by Better Search and post_content get searched.

    Is there any solution to this other than disabling the plugin?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hi @matthewmorete,

    Thank you for your message.

    I have prepared an update to the plugin that adds support for the post_search_columns filter. You can download the plugin update to version 4.3.1 now and test it.

    Then please let me know if everything works fine for you too.

    Best,
    Mateusz

    Thread Starter matthewmorete

    (@matthewmorete)

    Thank you so much for responding and supporting this so incredibly quickly.
    Testing on my site it works perfectly!

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @matthewmorete, I’m glad I could help! If you’re happy with the plugin and my support, I’d really appreciate it if you could leave a quick review on ww.wp.xz.cn – it helps others and means a lot to me. You can add your review here.

    Thanks a ton! Let me know if you ever need anything.

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

The topic ‘Exclude post_content from search’ is closed to new replies.