A Laravel package that simplifies the integration with IndexNow API to notify search engines about URL changes in real-time.
This package provides an elegant way to notify search engines about changes to your website's URLs using the IndexNow API. Perfect for keeping search engines updated when content is created, modified, or deleted on your website.
IndexNow is an open protocol that enables websites to instantly inform search engines about latest content changes. This ensures faster indexing and more up-to-date search results.
- 🚀 Instant search engine notification
- 📦 Simple integration with Laravel
- 🔄 Support for single and bulk URL submissions
- 🛡️ Built-in spam prevention
- 📝 Detailed logging system
- ⚙️ Configurable environment settings
- PHP 8.0 or higher
- Laravel 8.0 or higher
Install the package via Composer:
composer require ymigval/laravel-indexnow
- Publish the configuration file:
php artisan vendor:publish --tag="indexnow"
-
Generate an IndexNow API key from one of these services:
-
Add your API key to the
.env
file:
INDEXNOW_API_KEY=your_api_key_here
Place your API key file at your domain's root with a .txt
extension:
https://www.example.com/4cea016a4ddb408592569456a9c4896b.txt
Helpful commands:
# View your IndexNow API key
php artisan indexnow:apikey
# If the route doesn't work, clear and cache routes
php artisan route:clear
php artisan route:cache
# Check IndexNow package status and configuration
php artisan indexnow:status
The indexnow:status
command will help you verify:
- API Key configuration and validity
- Key file accessibility
- Configuration file status
- Search engine settings
- Submissions status
- Logging configuration
- Spam protection status
- Route registration
- Overall package status and provide recommendations
use Ymigval\LaravelIndexnow\Facade\IndexNow;
IndexNow::submit('https://www.example.com/my-page');
use Ymigval\LaravelIndexnow\Facade\IndexNow;
// Using array
IndexNow::submit([
'https://www.example.com/page-1',
'https://www.example.com/page-2',
'https://www.example.com/page-3',
]);
// Or using method chaining
IndexNow::setUrl('https://www.example.com/page-1')
->setUrl('https://www.example.com/page-2')
->setUrl('https://www.example.com/page-3')
->submit();
The package includes built-in spam protection that temporarily blocks requests for 24 hours when suspicious activity is detected.
View action logs using the Artisan command:
php artisan indexnow:logs
See CHANGELOG for all notable changes.
This package is open-source software licensed under the MIT License.
Contributions are welcome! Please see the contributing guide for details.
If you find this package helpful, please consider giving it a star on GitHub!