Sign Up

Captcha Click on image to update the captcha.

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people's questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Don't have account, Sign Up Here
Please subscribe to paid membership

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

GetSolu.com

GetSolu.com Logo GetSolu.com Logo

GetSolu.com Navigation

  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Home
  • About Us
  • Blog
  • Contact Us
Home/ Problems/Q 3529
Next
Need More Solution
Anonymous
  • 0
Anonymous
Asked: October 17, 20222022-10-17T08:08:57+00:00 2022-10-17T08:08:57+00:00In: Website

How to hide products that ware sold out in woocommerce?

  • 0

The products sold out and I will not continue to sell them. However, these products still show on my website by categories.

I don’t want to remove them because this is not good for SEO. I also try to create a new category, but this category appears in many places on my website.

I just want to hide them in selling product categories, and keep the links. Could you give me a solution for that?

woocommercewordpress
  • 2 2 Answers
  • 32 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. Mr. Zero
      2022-11-02T09:43:04+00:00Added an answer on November 2, 2022 at 9:43 am

      It’s easy to hide any product you don’t want to appear in the category where the product link is not affected.

      Open the products list on the admin page, take the mouse to a product you want to hide, and then click on “Quick Edit”. You will see the Visibility and select “Hidden”. Click update to save.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. ChatGPT
      2023-02-01T15:04:32+00:00Added an answer on February 1, 2023 at 3:04 pm

      You can use a plugin or custom code to hide sold out products in WooCommerce. Here are the steps to achieve that:

      1. Use a plugin: There are several plugins available that allow you to hide sold out products in WooCommerce. For example, the “WooCommerce Out of Stock Visibility” plugin can help you achieve this. Simply install and activate the plugin, and it will automatically hide sold out products in your product categories.
      2. Custom code: If you are comfortable with coding, you can add the following code to your child theme’s functions.php file to hide sold out products:

      add_filter( ‘pre_get_posts’, ‘hide_out_of_stock_products’ );
      function hide_out_of_stock_products( $query ) {
      if ( $query->is_main_query() && ! is_admin() ) {
      $meta_query = $query->get( ‘meta_query’ );
      $meta_query[] = array(
      ‘key’ => ‘_stock_status’,
      ‘value’ => ‘outofstock’,
      ‘compare’ => ‘=’
      );
      $query->set( ‘meta_query’, $meta_query );
      }
      return $query;
      }

      This code will hide sold out products in your product categories, but the links to these products will still remain active and accessible.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Forgot Password?

    Need An Account, Sign Up Here

    Sidebar

    Add Your Problem

    Recent Posts

    • Best Medical WordPress themes
    • Register a domain from Namecheap
    • 13 ways to increase subscribers for Youtube channels free and effective
    • Guide to choosing a domain to develop a website, blog, brand
    • How to upload source file to hosting

    Recent Comments

    • ChatGPT on Create and print invoice from website used Woocommerce with WordPress
    • ChatGPT on Need show post by timeline on my blog website
    • ChatGPT on I want to find a software collage of photos with text that can edit
    • ChatGPT on How to hide products that ware sold out in woocommerce?
    • ChatGPT on Need flexible website for my company

    Explore

    • Home
    • Communities
    • Questions
      • New Questions
      • Trending Questions
      • Must read Questions
      • Hot Questions
    • Polls
    • Tags
    • Badges

    Footer

    The whole community of experts and knowledgeable people can offer solutions to your problem. Your job is just to describe your problem in as much detail as possible.

    • Terms of Service
    • Privacy Policy

    © 2022 Get Solu. All Rights Reserved
    With Love by Mr. Zero.

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.