Understanding IndexNow
Traditional search engines rely on crawlers that revisit websites periodically to check for changes. This process can take days or weeks.
With IndexNow, search engines receive immediate notifications, ensuring that your most recent updates appear faster in search results.
When you make any changes to your website, such as:
- Publishing a new blog post or page
- Updating existing content
- Removing outdated content
Think of IndexNow as a direct line of communication between your website and search engines. Instead of waiting for search engines to discover changes on your website - which can take days or even weeks - IndexNow lets you instantly notify them about updates. It's like having a hotline to tell search engines, "Hey, I've just published something new!"
Important Note: Before implementing any changes, please test these steps in a development environment first. This guide reflects current implementations as of February 2024. Always refer to the official Microsoft Bing IndexNow documentation for the most up-to-date information.
Quick Implementation with CMS Plugins
The easiest way to implement IndexNow is through plugins available on the Microsoft Bing IndexNow site. Here's a comprehensive list of supported platforms and their available plugins:
Platform | Available Plugins |
---|---|
WordPress |
|
Shopify | InstaIndex |
Joomla! |
|
Bitrix24 | Built-in support available |
Additional platforms include:
- Drupal
- PrestaShop
- MODX
- Shopware
- Opencart
- Typo3
- Umbraco
Manual Implementation Guide
If your platform isn't listed above or you prefer more control over the implementation, let's walk through the manual setup process step by step.
Prerequisites
- Access to your web server, cPanel or Plesk control panel.
- Ability to create and modify files in your website's root directory
- Basic understanding of command line operations (for automation)
Step 1: Generate and Host Your API Key
- Visit IndexNow | Bing Webmaster Tools, click the "Get Started" button to download a text file containing a 32-character key
- Upload this file to your website's root directory
- Verify the file is accessible at: https://example_domain.com/01234567899876543210123456789001.txt
Step 2: Submit URLs to IndexNow
You have these methods for submitting URLs. Let's understand each one:
Method 1: Using cURL
Run the following command in your server terminal:
curl -X POST "https://www.bing.com/IndexNow?url=example_domain.com&key=01234567899876543210123456789001"
curl -X POST "https://www.bing.com/IndexNow?url=https://example_domain.com&key=01234567899876543210123456789001"
Method 2: Using Python
If you prefer scripting, here's a Python script to automate the submission:
import requests
# Your API Key
api_key = "01234567899876543210123456789001"
# URLs to Submit
sitemap_urls = [
"example_domain.com",
"https://example_domain.com"
]
# Submit each URL
for url in sitemap_urls:
response = requests.post(f"https://www.bing.com/IndexNow?url={url}&key={api_key}")
print(f"Submitted {url}: {response.status_code} - {response.text}")
JSON Submission (optional - if the above didn't work)
curl -X POST "https://www.bing.com/IndexNow" \
-H "Content-Type: application/json" \
-d '{
"host": "example_domain.com",
"key": "01234567899876543210123456789001",
"urlList": [
"https://example_domain.com/page1",
"https://example_domain.com/page2"
]
}'
Method 3: Query Parameters
curl -X POST "https://www.bing.com/IndexNow?url=https://example_domain.com/page1&key=01234567899876543210123456789001"
Step 3: Automated Implementation for Hosting Platforms
Step 3: Automating URL Submission (Optional)
For automatic submission when new content is published, add this script to your cron job (Linux) to run daily:
echo "Submitting IndexNow sitemaps..."
curl -X POST "https://www.bing.com/IndexNow?url=https://www.example_domain.com/$url1&key=01234567899876543210123456789001"
curl -X POST "https://www.bing.com/IndexNow?url=https://www.example_domain.com/$folder/$url2&key=01234567899876543210123456789001"
echo "Done."
cPanel Implementation (Shared Hosting)
Follow these steps to automate IndexNow submissions in cPanel environments:
1. Create the Submission Script
- Log in to cPanel
- Navigate to File Manager → public_html
- Click "New File" and name it indexnow-submit.php
- Add the following code:
<?php
$api_url = "https://www.bing.com/IndexNow";
$api_key = "01234567899876543210123456789001";
$urls = [
"https://example_domain.com/page1",
"https://example_domain.com/page2"
];
$data = json_encode([
"host" => "example_domain.com",
"key" => $api_key,
"urlList" => $urls
]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
file_put_contents('indexnow-log.txt', date('Y-m-d H:i:s') . " - Response: " . $response . "\n", FILE_APPEND);
echo "IndexNow submission response: " . $response;
?>
2. Set Up the Cron Job
- In cPanel, go to Advanced → Cron Jobs
- Under "Add New Cron Job", configure:
- Common Settings: Select "Once Per Day"
- Command:
/usr/local/bin/php -q /home/username/public_html/indexnow-submit.php
- Replace "username" with your cPanel username
- Click "Add New Cron Job"
Plesk Implementation
For Plesk users, follow these steps to set up automated IndexNow submissions:
1. Create the PHP Script
- Log in to Plesk
- Go to File Manager
- Navigate to httpdocs folder
- Create a new file named indexnow-submit.php
- Use the same PHP code as shown in the cPanel section above
2. Configure Scheduled Task
- In Plesk, go to Scheduled Tasks
- Click "Add Task"
- Configure the following:
- Run: Daily
- Command:
/usr/bin/php -q /var/www/vhosts/domain.com/httpdocs/indexnow-submit.php
- Replace "domain.com" with your actual domain
- Click "OK" to save
Important Security Notes:
- Set file permissions to 644 for the PHP script
- Keep your API key secure and never expose it publicly
- Monitor the log file regularly for any issues
- Consider adding IP-based access restrictions to the script
Troubleshooting Tips for Hosting Implementations:
- Verify PHP has cURL support enabled
- Check file permissions and ownership
- Monitor indexnow-log.txt for submission responses
- Ensure the correct path is used in cron commands
Troubleshooting Common Issues
HTTP Code | Meaning | Solution |
---|---|---|
200 | Success | URL submitted successfully |
400 | Bad Request | Check URL format and JSON structure |
403 | Forbidden | Verify API key file accessibility |
422 | Unprocessable Entity | Ensure URLs match the host domain |
429 | Too Many Requests | Reduce submission frequency |
Suggested Best Practices and Tips
When implementing IndexNow, keep these important points in mind:
- Always test your implementation in a development environment first
- Keep your API key secure and avoid sharing it publicly
- Monitor your submissions through search engine webmaster tools
- Set up automated submissions for regular content updates
- Verify that your key file remains accessible