• Hi there! I encountered an issue with the Search & Filter Free plugin where searching by tags resulted in a 404 error when using a custom permalink structure. The search worked fine for categories but not for tags.

    Steps to Reproduce:

    1. Set up the Search & Filter Free plugin with a form to search by name, category, and tag.
    2. Use a custom permalink structure.
    3. Submit a search using only tags.

    Expected Behavior:

    The search should return results without resulting in a 404 error.

    Actual Behavior:

    Submitting a search with tags resulted in a 404 error page.

    Solution:

    To resolve the issue, I modified the URL generation in the plugin’s code:

    1. I added the following line to correctly get the tag base: $tag_base = ( get_option( 'tag_base' ) === '' ) ? 'tag' : get_option( 'tag_base' );
    2. I updated the URL path to include the tag base correctly: $tag_path = $tag_base . '/' . $tags . '/'; instead of $tag_path = 'tag/' . $tags . '/';

    This change ensured that the tag URLs were generated correctly, eliminating the 404 error when searching by tags.

    My Question:

    I would like to know if there are any existing filters or actions in the plugin that could be used to make this change update-proof, since direct changes to the plugin files can be overwritten with future updates. I couldn’t find anything about it in the documentation.

    Thank you!

  • You must be logged in to reply to this topic.