I want to know how to get visibility of product using Magento 2. I have a product that is set to "not visible individually" and want to remove it from a collection.

I have tried below methods:


But all products return the same value "1" for $product->isVisibleInCatalog visible or not.

I have reindexed via command line also and set the visibility for all stores to be not visible however still the issue persists.

  • and what's wrong with all the methods returning the same? Aug 15, 2017 at 9:33
  • 1
    Well i would hope the values would change depending on visibility...
    – harri
    Aug 15, 2017 at 9:34
  • aaah ok. Try reloading the product over the repository and check if the methods return correct value. Aug 15, 2017 at 9:37
  • Sorry yeah bit confusing the wording after all the methods that i tried. Im not sure what you mean by reloading product over the repository however.
    – harri
    Aug 15, 2017 at 9:38
  • Inject \Magento\Catalog\Api\ProductRepositoryInterface in your controller/block/service/whatever and then reload the product with $productReloaded = $this->productRepository->get($product->getSku()); Aug 15, 2017 at 9:41

1 Answer 1


You can get it via this :


Get visiblity text:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.