WooCommerce removing the reviews tab

May 15, 2012 | Ecommerce, PHP, Time Savers, Troubleshooting, Tutorials, WooCommerce, Wordpress | 40 comments

UPDATE: If you are using WooCommerce 2.0+ then you need to read this blog post I wrote instead which explains the ‘new’ system for you.

Another quickie from me today. I have been using WooCommerce a lot recently but there are just some options that could do with making into options or filters I think. As I understand it’s a JigoShop rebadge with a bit of Woo goodness in there for luck and it seems to be paying off. I never want to use WP Ecommerce again at this rate.

Each WooCommerce installation will have the reviews tabs added to individual product pages. As I understand it it uses the WordPress comment system to hold review information (so says one forum, i’ve not bothered to check it out). I noted that people are wanting to know how to turn this functionality off as reviews don’t really apply to all products in all shops. Adding this code to your theme functions.php file will remove the reviews tab. If you want it back then just remove the lines.. simples.

remove_action( 'woocommerce_product_tabs', 'woocommerce_product_reviews_tab', 30);
remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_reviews_panel', 30);

Edit:

People have asked how to remove the product attributes tab and the additional description tab also. You can do so using the following code:
remove_action( 'woocommerce_product_tabs', 'woocommerce_product_description_tab', 10);
remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_description_panel', 10);
remove_action( 'woocommerce_product_tabs', 'woocommerce_product_attributes_tab', 20);
remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_attributes_panel', 20);

Also see my new tutorial in how to add a new tab to the WooCommerce product pages

A Donate Button!

40 Comments

  1. Robert

    Sean, I am using woocommerce inside of a site I am building with Ultimatum. It’s a custom theme builder if you’re not familiar. Anyway, I’ve been trying desperately to remove all product images, as they are not relevant to what is being sold. However, all the advice I am finding online is not working.

    I tried inserting the code you gave here, but it had not effect. Is there a certain place inside of the functions.php file that I am supposed to put it to make it work?

    Thanks for your help.

    Reply
    • Sean

      Hi Robert, I think i should look at the code for your theme. Can you send me the theme files to barton.sean@gmail.com and I shall review it and let you know how to remove all product images as requested.

      thanks
      Sean

      Reply
  2. Guillaume

    HI!

    Thanks for the non-review code, it works just fine! I’m looking to suppress the “description” tab that’s just beside the “review” tab in the product page… Could you give me the code?

    Thanks a lot!

    Guillaume

    Reply
    • Sean

      Hey, these are the lines that add those panels. You will recognise the bottom one of each section as reviews. just use the appropriate string from these to remove the others if you like. Let me know if you need any help.

      ta
      S

      add_action( ‘woocommerce_product_tabs’, ‘woocommerce_product_description_tab’, 10 );
      add_action( ‘woocommerce_product_tabs’, ‘woocommerce_product_attributes_tab’, 20 );
      add_action( ‘woocommerce_product_tabs’, ‘woocommerce_product_reviews_tab’, 30 );

      add_action( ‘woocommerce_product_tab_panels’, ‘woocommerce_product_description_panel’, 10 );
      add_action( ‘woocommerce_product_tab_panels’, ‘woocommerce_product_attributes_panel’, 20 );
      add_action( ‘woocommerce_product_tab_panels’, ‘woocommerce_product_reviews_panel’, 30 );

      Reply
  3. Daniel

    hi,

    i want to remove the “sumit yours” link and set a form like a contact form to teh revies, do you have a tutorial for this?

    Greets,
    dan

    Reply
    • Sean

      hi Dan, sorry about the delay on this but yes I do have that tutorial now written. Check out my latest post on the site. You can remove the review tab using the code in the post above and you can add a new tab using the following blog post.

      Any more ideas please let me know.

      ta
      S

      Reply
  4. Guillaume

    Hi Sean,

    Thanks a lot, but I still can’t figure out which line I should include in the file…

    Thanks

    Reply
    • Sean

      Hey.. just put it in your theme functions.php file at the bottom.

      ta
      S

      Reply
  5. Mick Buckley

    Hi Sean, I grew up in Crewe but now I’m a website developer living in New Zealand. I needed to remove the Additional Information and Review tabs on a Woocommerce site I’m building this page came up first hit on Google. Thanks! Now I’ll think of Crewe every time I browse the product catalog.

    Reply
    • Sean

      Hey Mick, wow you got out. Nice one 🙂 I live in Wistaston thankfully on the outskirts so not quite the war zone. Glad you got it sorted. By all means let me know if you need anything else. Always happy to help.

      thanks
      Sean

      Reply
  6. Gene

    Hi Sean,

    Thanks for the code snippet, works great!

    I’m wondering if you know how to remove the related products section that appears below the tabs… I found this snippet on the WP forums but it doesn’t seem to work for me.

    remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_related_products’, 20);

    Reply
    • Sean

      Hi Gene,

      Thanks for your comment. That snippet is correct but it depends on placement and load order. Put it in your functions.php file for your theme for starters. If that doesn’t work then add it into a code block called by another function or hook

      add_action text123() {
      remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_related_products’, 20);
      }

      add_action(‘init’, ‘text123’,30);

      It might help. Let me know

      thanks
      Sean

      Reply
  7. Mark

    I’m using woocommerce Version 1.6.6. The above didn’t work for me. I did however find a very simple solution.

    Assuming you have copied the template files from the plugin to a woocommerce folder within your theme. You will find that these tabs now have there own template files.
    your folder > single-product > tabs > tab-reviews.php

    To remove display of the tab on the front end
    simply open the file and modify as below:

    add <!– before the first and add –> after the Save the file and voila no more review tab!

    This can be repeated for the attributes tab and the description tab.

    Reply
    • Sean

      Hi Mark,

      Though I agree that is one method of removing the tab it does actually still show it. You are simply suggesting that we hide it from view using an HTML comment.

      My method does work. Perhaps conflicts with implementation maybe. Not sure although I used the same code this morning with no issue. However your approach is still valid. I would simply use the following code though:

      < ?php return; ?> which should cause the tab to disappear or indeed just delete the contents of that file.

      thanks
      Sean

      Reply
      • Mark

        Sean

        Thank you for your quick reply. I wasn’t saying that you method didn’t work at all
        I was saying that it didn’t work for me.
        I’m fully aware that the code you provide goes into my functions.php file.
        You are correct that removing the line entirely would also serve the same purpose. However, I have opted to comment out the line for convenience as clients often change their minds!!
        You are incorrect in saying that the tabs does actually show as it doesn’t show at all. In fact any code that you comment out correctly will not show in a browser (it is present in the source code though)
        Another way of achieving the same is to set #tab-reviews to display:none in the stylesheet.

        Many Thanks

        Mark

        Reply
        • Sean

          Thanks Mark,

          I wanted to make it clear to people that the code does work is all. Your method is, of course, valid although my point perhaps not explained properly. I was incorrect in saying it shows it but the next sentence highlighted my point. The user still has to download that markup in order for it to be hidden in the background and not used. A PHP commect, is using that method, would be more appropriate as the markup would not be sent to the browser at all.

          What theme are you using by the way? There must be a reason that the action can not be removed using my standard method.

          ta
          S

          Reply
          • Mark

            Sean

            Xing – Woocommerce – Themeforest.

            Although I wish i’d of coded the whole thing myself from scratch now!! I’ve practically had to rewrite the stylesheet.

            Can’t say why it didn’t work. Theme hooks, woocommerce hook changes, maybe even WP 3.5.1 conflict (doubtful)

            I could install debugthis plugin and find out but frankly I want to get this project out and billed as its boring me to distraction…

            You will never ever write a piece of code that works for 100% of people… too many different server environments and too many different theme and plugin setups.

            BTW I’ll be removing it later to a when I go through the minification and optimisation stage

            Cheers

            M

  8. Vladimir

    Hi Sean,

    My goal is – remove tabs, but leave description text only.
    Is it possible to do with remove_action()?
    Or his here one way – edit templates?

    Reply
    • Sean

      Hi Vladimir,

      I think this is possible if you just remove the tab portion and not the panel?

      Let me know how you get on.

      thanks
      Sean

      Reply
      • Vladimir

        Hi Sean,

        Thank you for advice.
        I tried all variants, but no luck 🙁

        For now I just setup “display: none;” in css for class “tabs”. Not good solution, but I do not see better variants for now.

        Reply
  9. Tarek

    Where is “theme functions” located?

    I see /admin/woocommerce-admin-functions.php
    woocommerce/woocommerce-functions.php
    woocommerce/woocommerce-core-functions.php

    Reply
    • Sean

      Hi Tarek,

      None of those sorry. Your theme is within wp-content/themes/[theme_name]/ so functions.php is under there.

      ta
      S

      Reply
      • Chris

        I put it in that file yet it’s still not working, any idea?

        Reply
        • Sean

          Hey Chris,

          I suspect you are using the latest version of WooCommerce which uses a different tabbing method. Check my site for the WooCommerce 2.0+ version which will work fine.

          thanks
          Sean

          Reply
  10. Fritz

    Great stuff here, thanks for sharing!

    What I need to do is a bit different…maybe a subject for a separate post/tutorial. I don’t want to hide the Reviews tab. I want it to show but I want only registered (logged in) users to be able to leave a product review (to reduce spam.) Of course everyone should be able to see the reviews.

    Thanks in advance for any help you can give on this!

    Reply
    • Sean

      Hey Fritz,

      Actually this is quite simple in the WooCommerce 2.0 system. Use the following code:

      add_filter( 'woocommerce_product_tabs', 'sb_woo_remove_reviews_tab', 98);

      function sb_woo_remove_reviews_tab($tabs) {
      if (!is_user_logged_in()) {
      unset($tabs['reviews']);
      }

      return $tabs;
      }

      Reply
  11. Pranjal

    Hello Sean,

    I need your little help, can you please tell me how to change the title of the review tab to something else. Actually, instead of Review (count), I want to rename it to User Review (count). Will you please guide me where to edit the following title?

    Thanks

    Reply
    • Sean

      Hi Pranjal, please see my latest blog post which shows you how to rename the reviews tab as well as remove it and add tabs of your own.

      thanks
      Sean

      Reply
      • Pranjal

        Thanks, tried that code it worked on my test setup where I am running on WooCommerce 2.0 while, on my actual running site it failed to rename the tab, where I am running V1.6.6.

        Does that code works only on the latest version of the WooCommerce?

        Thanks!

        Reply
        • Sean

          Yep it only works on the latest version. I suggest you upgrade really.

          Reply
  12. Chad

    Hello Sean!

    I’m a noob with woocommerce and I am simply trying to move the tabs (prod. desc. and reviews) out of the main content and add it under the sidebar call so I can have the tabs under both the main content and the sidebar. Unfortunately it hasn’t been so simple to accomplish.

    Any help would be greatly appreciated!

    Reply
    • Sean

      Hey Chad,

      You could do this using the custom template option in WooCommerce and moving the tab content away. It’s no quick job for an amateur though if you don’t have the ability with PHP or WooCommerce.

      thanks
      Sean

      Reply
  13. Allen

    Hey Sean, Seems like you may be my best option here…

    I have a site where the client wants their reviews on it’s own “review” page. Is there a way to accomplish this?

    Thanks much in advance for any help!!!

    – Allen

    Reply
    • Sean

      Thanks Allen,

      I would suggest you use a testimonials plugin and call it reviews instead. Then just add the testimonial form to each product page in a new tab following my WooCommerce new tab tutorial.

      thanks
      Sean

      Reply
  14. Dan

    I can’t for the life of me get this to work. Using latest version of Woocommerce and WP, to know avail. Been adding to the theme functions.php file, and it does nothing. Where am I going wrong?

    Reply
    • Sean

      You would need to use the latest version of the code. WooCommerce changed their code structure for V2 and this blog post relates to pre-2.0. See the related post for the solution.

      thanks
      Sean

      Reply
  15. Deepz

    Can you please help me,how to add really simple captcha to woocommerce review system?.Which file i should edit for that ?…etc

    Reply
    • Sean

      Hi Deepz,

      Because the review system is based on the comment system in WP any normal comment Captcha should work. I like WP Recaptcha because its operated by Google and reliable.

      thanks
      Sean

      Reply
      • PL

        Can WP Recaptcha also add to Woocommerce Registration and log in form as well? How??

        Reply
        • Sean

          Yes but it requires coding as WooCommerce seems to use different login and register actions which normal CAPTCHA systems would hook into.

          Reply

Trackbacks/Pingbacks

  1. Adding your own tabs to Woocommerce and Woothemes | Tortoise IT - [...] Further Reading, my original post on the matter [...]
  2. SB WooCommerce Facebook Comments Plugin | Tortoise IT - [...] was requested by a commenter on a previous post on a similar subject. I have written in the past…
  3. How to remove the WooCommerce 2.0+ Reviews tab | Tortoise IT - [...] around the tab system in previous months and if you have yet to upgrade to 2.0 then you will…

Leave a Reply

Divi United

About this site and Sean Barton

Picture of Sean
Sean Barton is a Freelance PHP Website Developer in Crewe, Cheshire. He is a Wordpress and CMS/Framework specialist.
This site was set up in 2008 as a tutorial and scripting resource for the PHP language and Wordpress.
Find out more about Sean on the About Me page or use the Hire Me page to get in touch. For more information about Sean's work take a look at the Portfolio

Our Services

  • Wordpress plugin/theme development
  • Divi specialist
  • Ecommerce (Woocommerce, WPSC, Shopify, Magento)
  • PSD to Wordpress theme conversion (Responsive)
  • Website design work (Banners, Logos, Full Site, etc)
  • Website analysis (security, usability, SEO)
  • API Integrations (InfusionSoft, SalesForce, Ontraport, Customer Thermometer, etc..)
  • Wordpress consultancy & expert advice
  • Crisis support
  • Website hosting

The main services offered are Wordpress based although we do a great deal of technical programming for bespoke systems. From troubleshooting, extending frameworks, finding bugs to writing them from scratch.

Find out more by looking through our past projects or get a quote.

Be the first to hear about new products/updates!

This is a mailing list for those people interested in being told when we release a new product (Divi plugin or Theme).

We shall also use this list to let you know about product updates and releases.

You have Successfully Subscribed!