How to reindex Magento 2 store
Reindex is a Magento thing, caused by the specifics of Magento database. In Magento 1, users had to run reindex after every bulk update. In Magento 2, you set up a cron job and reindex is run automatedly on a schedule.
However, there are still situations when you need to run reindex manually. For example, you've made massive changes to your catalog to want check if updates were applied successfully (without having to wait for the scheduled reindex). Or perhaps, you work on a local host or a dev site without a cron job.
Besides, reindex is often the final solution you resort to when you face an issue of an unknown nature. Let's discuss those issues below and learn how to run Magento reindex.
- URL rewrites for grouped products don’t redirect to clean SEO URLs.
- Configurable product prices are displayed as zero at the front though being different in the admin.
- Products are not showing up after Magento 2 import.
- Uploaded images are not visible at the storefront.
These issues were fixed through reindex. So, if you face similar issues and want to try the reindex as a solution, here is how you run it.
Read more about what to check if products are not showing up after Magento 2 import or uploaded images are not visible at the storefront.
If you receive a notification: “One or more indexers are invalid. Make sure your Magento cron job is running”, you should check it in your admin panel navigating to System -> Index management. There you will see which items have the status ‘Reindex required’ and have to be reindexed.
You can check your reindex mode. You can set your indexers to:
- "Update on Save" - store entities will be indexed when admin configurations are saved.
- "Update by Schedule" and indexers will be refreshed each recurring period. In order automated reindex to work, make sure your cron jobs are running correctly on your server. Your hosting partner or developer can help you with the cron jobs configuration.
So how to reindex Magento 2 from the admin panel? Well, unlike Magento 1, Magento 2 doesn't have an option to run reindex manually.
There are lots of tutorials online explaining the task. However, non-tech people might get confused. So here is a step-by-step explanation of what details are needed and where to paste them.
- Get Access Details.
- Install an SSH Client and log in.
- Run the Command.
First of all, you need SSH access details. If you have cPanel access, you can generate them yourself in Advanced Section -> SSH/Shell Access. If you have no idea what this is, ask your developer, administrator, or hosting provider to send you SSH access details.
You need an SSH client to use the above-mentioned credentials to log in. You can use a free program called PyTTY. After it is installed, start it and input the access details.
When the remote server's command line prompt appears, you are connected. The initial command line prompt looks like a small black screen with a username and the symbols
To run the command, you need to be located in your store root directory. How to know this? If you see an ‘app’ directory, you are there. If not, the directory can be changed to the one where Magento is installed, using this command cd public_html. To view files of this directory, use
After you reach the directory containing the ‘app’ folder, paste the following command here:
php bin/magento indexer:reindex
This command will execute a full reindex and you will see a line informing you that the index was rebuilt successfully.
For people without tech skills, the instructions described above may seem too complicated. Luckily there is an alternative way to run reindex from the Store Manager for Magento application.
Store Manager is a downloadable application that enhances the default Magento functionality with tools for bulk edits, seamless import/export, database backup, data generation, and others.
If you don’t have Store Manager yet, download a free trial and install it on your computer. Connect the application to your store database and enjoy the simplicity of your store administration.
The application includes options to run reindex for your products, categories and catalog. This way you can send a request to trigger reindex procedure directly from the app.
Moreover, performing massive inventory updates or uploading new products to your Magento 2, you can configure setting to refresh indices right after import. So you will not have to spend additional time on that.
Reindex Magento 2 Data Without with a Button Click! Try FREE now!
Store Diagnostics – Troubleshoot Magento Website Problems
The list of Magento store diagnostics types and their explanation. Read More...
Schedule Automated Cron Tasks Not Overloading Your Server
Check the tips to prevent your Magento server from overload when executing cron tasks. Read More...