• Resolved hebhansen

    (@hebhansen)


    Hey Woo

    Can I remove “Search results for:” text when doing a product search? I always wondered why it’s there. If you search, I guess you know you did a search, so over explanatory imho.

    Note, I wish to keep the searched word/phrase. Example I search for “Beautiful Woman”, so I just want the heading output to be “Beautiful Woman”.

    I found this code but it removes the entire title/heading:

    function filter_woocommerce_page_title($page_title){
      if (is_search()){
        {$page_title = '';
      }
    }
    
    add_filter('woocommerce_page_title', 'filter_woocommerce_page_title', 10, 1);

    So how can I alter this code to make it work?

    • This topic was modified 7 months, 2 weeks ago by hebhansen.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support omarfpg a11n

    (@omarfpg)

    Hi @hebhansen,

    Thank you for reaching WooCommerce support. We’d love to help you! We can try to hide it through CSS or through PHP maybe, this would depend first on the theme you’re using. Can you share more details about this?

    Once we learn more we’ll be able to provide further directions.

    Cheers!
    -OP

    Thread Starter hebhansen

    (@hebhansen)

    @omarfpg
    That sounds great. I am on TT4, so a block theme. Theme is declared if that matters. I have Code Snippets for both css or php, so either is fine for me. It’s a search like this, that comes out no so pretty: https://svalinnart.com/?s=cat&post_type=product&v=dd65ef9a5579

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @hebhansen,

    To remove this text, remove the Search Results Title block from the product search result template or search result template. It’s the best and easiest way to accomplish this task without code.

    If this makes no difference, it’s best to ask for insight related to those on either the WooCommerce Advanced Facebook group or the WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question. You can also seek help from the following:

    Please note that writing or providing custom code or support for customization is not within the scope of our support policy.

    I wish I could help more, but hopefully, this gets you going in the right direction to get the job done.

    Thread Starter hebhansen

    (@hebhansen)

    I am not trying to remove search function On the contrary!

    I am looking for a snippet that does what is described above. Thx

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @hebhansen

    I am sorry, but we don’t have ready-made code snippets for this. However, as a workaround, you can add a custom CSS class and hide them using custom CSS.

    If this doesn’t meet your requirements, we recommend asking development questions on the #developers channel of the WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question. You can also seek help from the following:

    Please note that writing or providing custom code or support for customization is not within the scope of our support policy.

    I wish I could help more, but hopefully, this gets you going in the right direction to get the job done.

    Plugin Support omarfpg a11n

    (@omarfpg)

    Hi there ?? ,

    We haven’t heard from you in a while, so I’m going to mark this as resolved. Feel free to start a new thread in the TT4 theme forum if you have any more questions.

    All the best,
    Omar

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Remove “Search Results for”’ is closed to new replies.