PHP Package: spatie/robots-txt

The spatie/robots-txt PHP library allows you to manage and parse robots.txt files for improved SEO performance and website indexing.

Current Version: 2.5.2
Last Updated: 2025-09-19
PHP Requirement: ^8.1
Dependencies:
phpunit/phpunit
guzzle/guzzle
⚠️ To ensure full functionality, the above dependencies might be required.

Package Description

The spatie/robots-txt library offers a comprehensive set of tools to help you efficiently handle and analyze robots.txt files for search engine optimization purposes. With convenient parsing capabilities and advanced functionality, this library simplifies the management of website indexing instructions, ensuring better visibility and control over search engine crawlers.

📦 Show all available classes🔗 View on GitHub

Download Latest Version: 2.5.2

Download Download v2.5.2

Previous Versions

Code Integration Example

Make sure to include the correct namespace and class paths for proper usage.

<?php
// Example from PHPlibraries.com
require_once 'libs/spatie/robots-txt/2.5.2/loader.php';
require_once 'libs/sebastianbergmann/phpunit/12.4.1/loader.php';
require_once 'libs/guzzle/guzzle/7.10.0/loader.php';

use Spatie\RobotsTxt\RobotsTxt;

$obj = new RobotsTxt();
echo '✅ Test OK: ' . get_class($obj);
?>

We aim to make using PHP packages easier without Composer. If something doesn't work, let us know — we'll fix it promptly.

Community Discussion

Ask questions, share tips, or report issues below.