Skip to content

IndexNow for WordPress

Easy

Add your IndexNow key file to WordPress without a plugin, or with one line in your theme.

WordPress routes unknown paths through its own router, so simply having a file in the site root usually works — but some hosts and security plugins interfere. The FTP method below is the most reliable; the code method is best if you have no file access.

Step by step

  1. 1 Download your key file from your Index-now dashboard.
  2. 2 Connect to your site with FTP, SFTP, or your host's File Manager (in cPanel or Plesk).
  3. 3 Open the folder that contains wp-config.php — usually public_html, httpdocs, or www.
  4. 4 Upload a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6.txt into that folder. Do not put it inside wp-content or a theme folder.
  5. 5 Visit https://yourdomain.com/a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6.txt in a browser. You should see only the key.
  6. 6 Click Verify in your Index-now dashboard.

No file access? Add this to your theme's functions.php instead

<?php
// Serves the IndexNow key file at /a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6.txt without needing FTP access.
add_action('init', function () {
    $key = 'a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6';

    if (trim($_SERVER['REQUEST_URI'], '/') === $key . '.txt') {
        header('Content-Type: text/plain; charset=utf-8');
        echo $key;
        exit;
    }
});

The key shown is an example. Yours is generated when you add the domain.

Watch out for

  • If you use a caching plugin (WP Rocket, W3 Total Cache, LiteSpeed), purge the cache after uploading.
  • Wordfence and some security plugins block .txt files in the root — allowlist the file if verification fails.
  • On WordPress Multisite, each site with its own domain needs its own key file.

Then what?

Hosting the key file proves you own the domain — it doesn't submit anything on its own. You still need something watching for changes and calling the IndexNow API with the right URLs at the right time. You can build that yourself, or let us run it for $12 a year.

Set up automatic submission

Stop waiting to be found

Set it up once. We keep telling the search engines about every change you make, for $12 a year.