See the way the Google Indexing API for Magento 2 extension works.
The Google Indexing API extension allows you to send indexing requests directly to Google from the Magento admin panel. This significantly accelerates the process of indexing recent changes to website pages, thereby enhancing the visibility and rankings of your Magento 2 store.
To start configuring the module, go to Stores → Configuration → Amasty Extensions → Extensions → Search Engine Indexing → General.
Enable - set to Yes to activate the extension.
Indexing Lag (in minutes) - specify the number of minutes after which scheduled indexing requests will be dispatched to Google. The default is set to 15 minutes, but you can change it if needed.
Private Key JSON File - upload the JSON key file you generated and downloaded from the Google Cloud Console. Once the file is uploaded, click the Save button.
Check the connection status details in the table that appears after the file is uploaded:
The extension allows you to send indexing requests both manually and automatically. In this tab, you can configure automatic indexing.
Enable - set to Yes to allow automatic submission of indexing requests.
Auto-Indexing for Pages - select which pages the extension will automatically request indexing for when they are added, updated, or deleted.
Index Product Pages When Attributes Change - choose the attributes whose changes will trigger the submission of product page URLs for indexing.
Here, you can enable the cleaning of the Indexing Schedule Log and specify the number of days after which the records will be automatically removed.
This extension enables the manual submission of single or multiple URLs for indexing, as well as the deletion of these URLs from indexing. Navigate to Amasty → Extensions → Search Engine Indexing → Indexing Request to perform these actions.
1. Choose the appropriate operation from the Action dropdown first:
2. Paste the URL or URLs for which you’d like to perform the selected action for. Please input each URL in a new line if submitting multiple URLs.
3. Click the Submit button. After submission, you can track the current request statuses on the Indexing Schedule Log grid.
Also, you can request indexing for any particular Magento page of product, category, or CMS type by clicking the Submit for indexing button located at the top panel on its edit page.
Go to Catalog → Products → select the desired product from the grid→ click the Edit option in the Action column:
Go to Catalog → Categories → find and open the needed category:
Navigate to Content → Pages → find the desired page on the grid→ click the Edit option in the Action column:
All indexing requests, whether single or multiple, sent automatically or manually, are stored in the Indexing Schedule Log. To access the grid with these records, navigate to Amasty → Extensions → Search Engine Indexing → Indexing Schedule Log.
You can view and filter the following information on the grid:
If you are sure and are not going to make additional modifications to the page, you have the option to transmit its URL for indexing directly from the grid (without waiting for the indexing delay to expire) by clicking the Transmit Now button in the Action column.
Moreover, you can utilize two mass actions after ticking the needed products you want to apply them for:
To activate access to the Indexing API, we recommend taking the following steps:
1. Log into the Google Cloud (API) Console
2. Create a new project or use an existing one:
3. After the project is created, you will be asked to confirm it and enable the API:
4. Then, create a service account:
5. Generate private API keys:
6. Upload the downloaded file to the Private Key JSON File setting located in the Google Access Credentials tab of the extension.
7. Open Google Search Console to verify your site ownership
8. Click Add property, select its type, and specify the URL:
9. Download the provided HTML file, upload it to your Magento root folder and click the Verify button:
10. If the ownership is confirmed, you’ll be able to access the property settings by clicking the Go to Property button
11. Navigate to Settings → Users and Permissions and click the Add User button. Then, copy the value of the 'client_email' field from the JSON key file you downloaded from Google Cloud and paste it to the Email Address field. Select the Owner role from the Permission dropdown. Finally, click the Add button:
12. Run the google/apiclient command in the composer terminal.
That's it! Now you can not only send indexing requests using the extension but also check if they are indexed in Google Search Console (URL Inspection Tool).
Find out how to install Google Indexing API for Magento 2 via Composer.