If you have a Magento website and some/all of your products are not visible in frontend, or in stock then this tutorial is for you. These debugging tips are also explained and shown in this video https://youtu.be/8RVd5Kilo7E
Here are the things you can try to figure out why products are not visible, searchable or in stock in frontend:
In general, the issue gets fixed after you run indexing and clear the cache.
You can run indexing from the terminal using the command
You can clear the cache from the admin panel at System => Tools => Cache Management. You can also clear the cache using the command:
If the issue still exists, use the below techniques to find the issue.
Try to load the product using the URL which you can get in the Search Engine Optimization section of the product page in admin.
Check if the product is enabled or not. Your product should be enabled.
Check if the product is assigned to the website you are browsing from front end or not.
Check if the product is assigned to the category you are browsing or not.
Check if the product has quantity and salable quantity or not.
Check product stock status and change product stock status to in stock.
Check product visibility config. Make sure visibility is set to Catalog, Search
Check the website or Store View level config and make sure the above settings are also correct on website/store level.
If you are using configurable and associated products, make sure at least one of the child products has salable quantity and previously mentioned attributes enabled for that simple product.
Are you using multi-source inventory? Make sure salable quantity is available in at least one source location.
If the issue remains, there are other things you might look into.
Do you have custom modules in your project? Disable them to check. It might be that any of the custom modules might be causing the issue.
Save the product again and run indexing and cache clean. Might be any catalog table is not updated properly when you have created the product for the first time or imported the product using the System import feature. This can be helpful when you have created products programmatically instead of using the default product creation feature.
Are you using any other third-party caching application? Flush them and check.