注册会员
×

已有账号? 请点击

使用其他方式登录

Google Indexing接口让谷歌即时抓取你的网站


  1. Download Plugin Files

  2. Steps to Create an API Project

  • 2.1 Go to Google API Console

  • 2.2 Create a Service Account

  • 2.3 Add the Service Account as an owner

  • Configure the Plugin

  • Most Common Errors & Their Fixes

  • Ensure that you’re creating a new Indexing API project which you can do automatically by clicking here. And then click continue.

    indexing api

    If you see the following screen then you’ve successfully created the project:

    Please note: There is no need to click ‘Go to Credentials’ button. You can close this tab.

    2.2 Now create a Service Account

    Once you’ve created your project, create a service account by opening the service accounts page. And, if prompted, select the project you just created using the button near the top of the page:

    And once you have selected a project, click the Create Service Account button highlighted below:

    On the Create service account screen, enter a name and description for the newly created service account.

    Select and copy the whole Service Account ID (the one that looks like an email address) because you will need it later. Then, click on the Create button at the bottom:

    Once you’re taken to the next page, don’t forget to change the role to Owner and, as you might’ve guessed, click continue…

    Now download the file that contains your API key by clicking the Create Key button:

    Choose the default JSON format when prompted in the overlay, and click Create:

    2.3 Add the Service Account as an owner of your Google Search Console Property

    To do this, you’ll need to register and verify your website with the Google Search Console (if you haven’t done so already) which is super easy: just follow the recommended steps to verify ownership of your property.

    After verifying your property, open the Google Search Console, select your property on the left (if prompted), and then click on Settings near the bottom:

    Click on Users and Permissions:

    Click on the three dots next to your account, and then click on Manage property owners:

    A page will open in a new tab. Scroll to the bottom and click on the Add an owner button in the Verified owners section:

    A page will open in a new tab. Scroll to the bottom and click on the Add an owner button in the Verified owners section:

    Enter the Service account ID (the one you copied out earlier) in the new owner’s email address field and click Continue:

    Switch back to the previous tab and refresh it. You should now see the Service account listed as a new Owner.

    You can use a single ProjectService Account, and JSON API Key across multiple sites, just make sure that the Service Account is added as Owner for all the sites in the Search Console.

    3 Configure the Plugin

    3.1 Insert your API Key in the plugin settings

    After installing the plugin, just navigate to Rank Math > Indexing API Settings in your WordPress admin area, and paste in the contents of your JSON file, or just upload the file.

    Select the Post Types where you want the Indexing API to ping Google to crawl your website as soon as a post is published, updated, or deleted and click on Save Changes.

    Google Indexing API Settings in Rank Math

    3.2 Now it’s time to use Google’s indexing API to get any post or page on your site indexed almost instantly.

    Access Plugin’s Console Page from the Dashboard.Submit the Page.Check the status of already submitted URL.indexing your website instantlyUse the quick action links and the bulk submit functionality.

    And that’s it! We hope that you were able to make great use of this guide to help you get up and running with Google’s Indexing API.

    So, getting Google to index your site instantly wasn’t all that complicated after all, was it? If you have any questions, comments or suggestions – feel free to leave a comment below. We can’t wait to hear from you. ?

    Please Note: It will take a few minutes for your website to start crawling after successful submission. Learn more about the entire process here.

    PS: It would be remiss not to mention that we got the idea for this post after reading this post that David Sottimano wrote about Google’s Indexing API. Another article that’s worth checking out is Tobias Willmann’s in which he thoroughly tested the indexing API with normal URLs that do not have a job posting or Livestream structured data.

    PS 2: Officially, the API is for pages containing Job Posting and Livestream Structured data, however, from our internal tests and our public beta it seems that Google will crawl and index any page type regardless of the Structured data. It is an efficient way to get the page(s) crawled quickly, rather than requesting it from inside Google Search Console.

    Also, Google plans to use the Indexing API instead of Sitemaps down the line.

    4 Most Common Errors & Their Fixes

    4.1 How to install the plugin?

    You can install the plugin on your site like any other WordPress plugin, using one of these two methods:

    A) Upload via WordPress Dashboard

    Upload the ZIP file from your WordPress dashboard, in Plugins > Add New > Upload.

    B) Upload it through FTP.

    You first have to extract the zip file on your computer and then upload the new folder google-indexing-api-by-rank-math to your server, in the following folder: /wp-content/plugins.

    4.2 403 Permission denied. Failed to verify the URL ownership.

    Make sure the service account is listed as Owner for the site in Search Console:

    If you don’t see it there, follow these steps:

    On the next page, add the service account as an owner with the button:

    Then, head back to the Search Console and refresh to confirm that the service account has been added correctly.

    4.3 404 Requested entity was not found.

    Use the API Console to Publish/update the page once, then you can use the Get status action.

    4.4 403 Indexing API has not been used in the project [project name] before or it is disabled. Enable it by visiting [URL] then retry.

    Copy and paste the URL in your browser to open it, or go to this page and select your project in the dropdown near the top, then enable the API:

    4.5 Can I use the plugin without Rank Math?

    Yes, this is a standalone plugin that works independently of Rank Math. However, we recommend using it alongside Rank Math for optimal results.

    4.6 Can I use the same API Project/Service Account/JSON API key for multiple sites?

    Yes, you can use the same projectservice account, and API keys across multiple sites, just make sure to set the service account as Owner of all the sites in Search Console.

    4.7 Can I install and use the plugin on Site A to submit URLs from Site B?

    Yes, if the service account (which appears in the JSON API key) is set as Owner of Site B in Search Console.

    4.8 Can I submit pages that do not have Job Posting or Livestream structured data?

    The API officially supports pages containing Job Posting and Livestream structured data, and it is recommended to use only on such websites.

    However, from our internal tests and our public beta it seems that Google crawls, indexes (if the content is original, new, and helpful), and follow links on any page you submit through the API, regardless of its structured data.

    4.9 It’s been more than 24 hours and Google still didn’t index my page. What to do?

    In our tests, Googlebot crawled the pages we published through the API within minutes, and you can confirm the same on your site by checking the access logs.

    This however, does not always result in the indexation of the content. It may take anywhere from minutes to days or even weeks before a URL shows up in the search results. Using this plugin doesn’t guarantee that your pages will show up in the search results.