See llms.txt for all machine-readable content.

Back to Templates

Scan and fix WordPress noindex pages with Google Sheets and RankMath

Quick overview

This workflow reads URLs from Google Sheets, checks each page for noindex directives in the meta robots tag or X-Robots-Tag header, writes the status back to the sheet, and for rows marked “Needs index” calls the RankMath WordPress REST API to switch robots settings to index.

How it works

  1. Starts manually and loads URL rows from a Google Sheets tab, focusing on rows that match the configured filter.
  2. Processes the URLs in batches, fetching each page over HTTP and parsing the HTML and headers for meta robots and X-Robots-Tag values.
  3. Writes the detected robots status (for example NOINDEX, INDEX, noindex via header, no meta robots found, or an HTTP error) back to the Google Sheet.
  4. After the check completes, reads the rows where the Google Sheet “Note” column equals “Needs index.”
  5. Fetches each marked page again and extracts the underlying WordPress post or term ID from headers or page markup, while preparing a new robots value that replaces noindex with index.
  6. Sends the updated robots meta to the RankMath updateMeta REST endpoint in WordPress for rows with a valid object ID and records API errors for the rest.
  7. Updates the Google Sheet with the final result (INDEX or an error status) for each processed row.

Setup

  1. Create a Google Sheet with a tab named “All URLs” and columns named exactly: URL, Robots Tag, Note.
  2. Add your Google Sheets credential in n8n and replace YOUR_GOOGLE_SHEET_ID in all Google Sheets nodes with your spreadsheet ID.
  3. Add a WordPress API credential (for example using an Application Password) with permission to edit content, and replace https://your-site.example.com in the RankMath request with your WordPress site URL.
  4. Ensure RankMath is installed and its REST API is reachable, then mark rows you want switched by setting Note to “Needs index.”
  5. Optionally enable the disabled test limiter to run a small subset first, and avoid sorting the sheet while the workflow is running so row matching stays consistent.

Requirements

  • Google Sheets account with OAuth2 credential
  • WordPress site with the RankMath SEO plugin active
  • WordPress user that can edit posts, with an Application Password recommended
  • Network access from n8n to your site

Customization

  • Change the Needs index text in Get Rows Needing Index to use your own marker
  • Adjust the filter in Get URLs to check only the rows you want
  • Raise or lower the batch size and interval in the Fetch nodes to suit your server
  • Replace Run Check with a Schedule Trigger for regular checks
  • Adjust the robots values in Get Object ID, which keeps nofollow-type tags and replaces noindex with index

Additional info

The status INDEX means RankMath accepted the request, not that the page is confirmed indexable. Clear your cache and run the check again to verify. If your site still shows noindex after a run, compare the request body in the RankMath updateMeta node with the request your RankMath editor sends. Pages that expose no post or term ID get the status missing object_id and must be handled manually. Noindex can also come from an X-Robots-Tag header or another plugin, which this workflow cannot change.