fork download
  1. <?php
  2.  
  3.  
  4. /**
  5.  * IndexNow Bulk URL Submit Script
  6.  * --------------------------------
  7.  * This script submits one or more URLs to IndexNow (Bing, Yandex, Seznam, etc.)
  8.  * using the official API endpoint.
  9.  *
  10.  * Before using:
  11.  * 1. Make sure your verification key file is accessible publicly, e.g.:
  12.  * https://i...content-available-to-author-only...a.co/aaefcdc7ee59431a89b8da924049a989.txt
  13.  * 2. Ensure cURL is enabled in your PHP (check phpinfo()).
  14.  * 3. Upload this script to your server and run it in your browser or CLI.
  15.  */
  16.  
  17. $endpoint = "https://a...content-available-to-author-only...w.org/indexnow"; // Official IndexNow endpoint
  18.  
  19. $payload = [
  20. "host" => "inevia.co",
  21. "key" => "aaefcdc7ee59431a89b8da924049a989",
  22. "keyLocation" => "https://i...content-available-to-author-only...a.co/aaefcdc7ee59431a89b8da924049a989.txt",
  23. "urlList" => [
  24. "https://i...content-available-to-author-only...a.co/",
  25. "https://i...content-available-to-author-only...a.co/about-us-inevia/",
  26. "https://i...content-available-to-author-only...a.co/blog/",
  27. "https://i...content-available-to-author-only...a.co/case-study/",
  28. "https://i...content-available-to-author-only...a.co/services/",
  29. "https://i...content-available-to-author-only...a.co/book-a-demo/",
  30. "https://i...content-available-to-author-only...a.co/traveler-mes-smart-manufacturing-execution-system/",
  31. "https://i...content-available-to-author-only...a.co/workflow-management-in-manufacturing-traveler-mes/",
  32. "https://i...content-available-to-author-only...a.co/flight-deck-project-and-workflow-management-tool/",
  33. "https://i...content-available-to-author-only...a.co/time-and-task-management-tool-with-flight-deck/"
  34. ]
  35. ];
  36.  
  37. // Initialize cURL
  38. $ch = curl_init($endpoint);
  39.  
  40. if ($ch === false) {
  41. die("❌ Failed to initialize cURL. Please check your PHP setup.\n");
  42. }
  43.  
  44. // Set cURL options
  45. curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json; charset=utf-8']);
  46. curl_setopt($ch, CURLOPT_POST, true);
  47. curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
  48. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  49. curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  50.  
  51. // Execute request
  52. $response = curl_exec($ch);
  53.  
  54. // Error handling
  55. if ($response === false) {
  56. echo "❌ cURL Error: " . curl_error($ch);
  57. curl_close($ch);
  58. }
  59.  
  60. $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  61.  
  62. // Show result
  63. echo "<pre>";
  64. echo "βœ… IndexNow Submission Completed\n";
  65. echo "-----------------------------------\n";
  66. echo "HTTP Response Code: $httpCode\n";
  67. echo "API Response: $response\n";
  68. echo "-----------------------------------\n";
  69.  
  70. if ($httpCode == 200) {
  71. echo "πŸŽ‰ URLs submitted successfully to IndexNow!\n";
  72. } elseif ($httpCode == 202) {
  73. echo "⏳ Accepted for processing (will be indexed soon)\n";
  74. } elseif ($httpCode == 400) {
  75. echo "⚠️ Bad request β€” Check JSON format or key details.\n";
  76. } elseif ($httpCode == 403) {
  77. echo "🚫 Invalid API key or key file not found.\n";
  78. } elseif ($httpCode == 405) {
  79. echo "❌ Wrong HTTP method β€” Make sure it’s a POST request to https://a...content-available-to-author-only...w.org/indexnow\n";
  80. } else {
  81. echo "ℹ️ Unexpected HTTP code: $httpCode\n";
  82. }
  83. echo "</pre>";
  84. ?>
  85.  
Success #stdin #stdout 0.04s 25976KB
stdin
Standard input is empty
stdout
❌ cURL Error: Could not resolve host: api.indexnow.org