• Resolved cabotcheese

    (@cabotcheese)


    Hello,

    I like the tables I have created for my site using wpDataTables, but the content they contain doesn’t appear to be searchable from the WordPress search function, rather only from the search block [filter] that appears when a user hits the page or post containing the table. I assume this is because the content of the table is not in the page/post, but rather it is in a source CSV or XL file and is therefore missed.

    My users need to be able to find table content without knowing which page to go to find the table. Is this possible? I have searched FAQs and everywhere and I still can’t make it work.

    https://ww.wp.xz.cn/support/plugin/wpdatatables

    https://ww.wp.xz.cn/plugins/wpdatatables/

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

    (@wpdatatables)

    Hi there, thank you for using wpDataTables Lite.

    The content is generated via a shortcode, and the default WP search is not parsing the shortcodes, and not searching within the dynamically generated content.

    I would recommend adding a hook or using a filter that allows searching within dynamically generated content. But please note that this will SIGNIFICANTLY slow down the search, so perhaps you can consider a different navigation logic.

    Here are some solutions:

    https://searchwp.com/
    https://www.cminds.com/comparison-10-wordpress-search-plugins/

    Additionally you can cache the generated content with some caching plugin to improve performance, e.g. “wp super cache”.

    Thread Starter cabotcheese

    (@cabotcheese)

    HI!

    Thank you for the alternative suggestions for Search. I will note that in some cases, a Search plugin can break functionality that is based on default WP search logic. For example, some of my tables are generated using TablePress plugin, and Tobias has ‘hooked’ the default WP search to flag tables that are generated via shortcode and add a step to search within them. It works great, but the Search Everything plugin is unaware of this logic and therefore break the hook when enabled.

    You recommended:

    … adding a hook or using a filter that allows searching within dynamically generated content.

    I am not a web programmer so I would be unable to do this, and would prefer that logic to be bundled with the plugin, written by the supporting developer. I understand that such a hook may slow down search significantly, and I appreciate the heads-up.

    All that said, may I make a feature request? If you add a hook similar to the one they use in TablePress, perhaps it can be configurable as Enabled/Disabled with a Warning that it may slow down Search. That way the user can choose ?

    So much of my site content would be based on table data that without the ability to search within the table, my functionality is crippled. And, like I mentioned, adding search plugins to bridge the gap can add moving parts that break other things.

    Just to cross reference ideas, here is a description of how TablePress ‘hooks’ the default WP search, for reference:

    By default, WordPress does not search content that is generated by Shortcodes (like TablePress tables), as it basically never sees that content, but just the Shortcode.
    TablePress works around that by hooking into the search and adding an intermediate step: It will search all of its tables and then extend the WordPress search to not just search for the search terms, but also for all Shortcodes that have a table ID in them that contains the search terms.
    The WordPress search will then return a list of all posts/pages that contain such a Shortcode, alongside all “regular” search results.

    LET ME APPOLOGIZE FOR CROSS-REF AGAINST ANOTHER PLUGIN PROVIDER. I JUST WISH TO ADD CONTEXT, SINCE I HAVE HAD DIFFICULTY RESOLVING THIS ISSUE.

    YOU BOTH ARE AWESOME AND I LOVE THE WORK YOU DO !!!

    THANKS!

    Plugin Author wpDataTables

    (@wpdatatables)

    Thanks for the tip – let us review this and perhaps implement in the 1.1 version that we are working on.

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

The topic ‘Table content not searchable by default WP search function’ is closed to new replies.