PHPackages                             hryvinskyi/magento2-seo-robots-pack - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. hryvinskyi/magento2-seo-robots-pack

ActiveMetapackage

hryvinskyi/magento2-seo-robots-pack
===================================

Complete SEO Robots solution for Magento 2 with flexible directive management, multiselect UI, and independent X-Robots-Tag configuration

2.0.2(3mo ago)46671MIT

Since Dec 26Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/hryvinskyi/magento2-seo-robots-pack)[ Packagist](https://packagist.org/packages/hryvinskyi/magento2-seo-robots-pack)[ RSS](/packages/hryvinskyi-magento2-seo-robots-pack/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (6)Versions (12)Used By (0)

Magento 2 SEO Robots Pack
=========================

[](#magento-2-seo-robots-pack)

Complete SEO robots meta tag and X-Robots-Tag HTTP header management for Magento 2 with flexible directive management and comprehensive Google robots directive support.

Overview
--------

[](#overview)

This metapackage provides a complete solution for managing robots meta tags and X-Robots-Tag HTTP headers in Magento 2. Version 2.0 introduces flexible directive management, supporting all Google robots directives with independent configuration for meta tags and HTTP headers.

Included Packages
-----------------

[](#included-packages)

### Core Modules

[](#core-modules)

- **hryvinskyi/magento2-seo-robots-api** (v2.0.0) - API interfaces and contracts
- **hryvinskyi/magento2-seo-robots** (v2.0.0) - Core robots functionality with validation and migration
- **hryvinskyi/magento2-seo-robots-admin-ui** (v2.0.0) - Enhanced admin UI with multiselect directives
- **hryvinskyi/magento2-seo-robots-frontend** (v2.0.0) - Frontend application with independent X-Robots-Tag support

Key Features
------------

[](#key-features)

### Flexible Directive Management

[](#flexible-directive-management)

- **No limitations** - Combine any robots directives freely (not limited to 8 predefined options like v1.x)
- **Multiselect UI** - Hold Ctrl/Cmd to select multiple directives in admin
- **Comprehensive validation** - Automatically detects conflicting directives (e.g., index + noindex)
- **Pattern-based rules** - Configure directives per URL pattern with priority system

Demo
----

[](#demo)

[![configuration_settings.gif](docs/images/configuration_settings.gif)](docs/images/configuration_settings.gif)

### Supported Robots Directives

[](#supported-robots-directives)

#### Basic Directives (Select Multiple)

[](#basic-directives-select-multiple)

- `index` / `noindex` - Control page indexing
- `follow` / `nofollow` - Control link following
- `noarchive` - Prevent cached copy
- `nosnippet` - Prevent snippet display in search results
- `notranslate` - Prevent translation offers
- `noimageindex` - Prevent image indexing
- `none` - Equivalent to noindex,nofollow
- `all` - Equivalent to index,follow (default)
- `max-snippet:[number]` - Maximum snippet length (-1 for no limit)
- `max-image-preview:[none|standard|large]` - Maximum image preview size
- `max-video-preview:[seconds]` - Maximum video preview duration (-1 for no limit)
- `unavailable_after:[date]` - Content removal date (RFC 850 format)

### X-Robots-Tag Configuration

[](#x-robots-tag-configuration)

- Configure X-Robots-Tag HTTP header separately from meta robots tag
- Set different directives for HTTP header vs HTML meta tag
- Automatic fallback to meta robots if no independent configuration

### URL Pattern-Based Control

[](#url-pattern-based-control)

- Define robots directives per URL pattern (e.g., `*/product/*`, `catalog_product_view`)
- Priority-based matching (highest priority wins)
- Supports wildcards and full action names

### HTTPS &amp; Pagination Support

[](#https--pagination-support)

- Separate directive configuration for HTTPS pages
- Automatic robots directives for paginated content (?p= parameter)
- Special handling for 404 pages (automatic NOINDEX,NOFOLLOW)

Installation
------------

[](#installation)

```
composer require hryvinskyi/magento2-seo-robots-pack:^2.0
php bin/magento module:enable Hryvinskyi_SeoRobotsApi Hryvinskyi_SeoRobots Hryvinskyi_SeoRobotsAdminUi Hryvinskyi_SeoRobotsFrontend
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush
```

Configuration
-------------

[](#configuration)

Navigate to **Stores &gt; Configuration &gt; Hryvinskyi SEO &gt; Meta Robots**

### Basic Configuration

[](#basic-configuration)

1. **Enabled**: Set to "Yes" to enable robots management
2. **Robots Meta Header Rules**: Configure pattern-based rules
    - **Priority**: Higher priority rules match first
    - **URL Pattern**: Use wildcards (e.g., `*/customer/*`) or action names (e.g., `catalog_category_view`)
    - **Meta Robots Directives**: Select multiple directives (hold Ctrl/Cmd)
    - **X-Robots-Tag Directives**: Optionally configure independent directives for HTTP header
3. **X-Robots-Tag Rules (Independent)**: Separate rules for X-Robots-Tag header only
4. **Robots Directives for HTTPS Pages**: Multiselect directives for HTTPS
5. **Set NOINDEX,NOFOLLOW for 404 page**: Automatically apply to error pages
6. **Paginated Content**: Configure robots for pages with ?p= parameter
7. **Enable X-Robots-Tag Header**: Enable/disable HTTP header

### Configuration Examples

[](#configuration-examples)

#### Example 1: Noindex Product Pages

[](#example-1-noindex-product-pages)

- Pattern: `catalog_product_view`
- Meta Directives: `noindex`, `follow`
- Result: ``

#### Example 2: X-Robots-Tag

[](#example-2-x-robots-tag)

- Pattern: `cms_page_view`
- X-Robots Directives: `index`, `follow`
- Result:
    - HTTP Header: `X-Robots-Tag: INDEX,FOLLOW`

#### Example 3: Customer Account Protection

[](#example-3-customer-account-protection)

- Pattern: `*/customer/account/*`
- Meta Directives: `noindex`, `nofollow`, `noarchive`
- Result: Full protection from search engines

Migration from v1.x
-------------------

[](#migration-from-v1x)

### Automatic Migration

[](#automatic-migration)

Version 2.0 includes automatic migration via Setup Patch:

```
\Hryvinskyi\SeoRobots\Setup\Patch\Data\MigrateRobotsConfiguration
```

**What Gets Migrated:**

- Old code-based configurations (1-8) automatically convert to directive arrays:
    - Code 1 (NOINDEX\_NOFOLLOW) → `['noindex', 'nofollow']`
    - Code 4 (INDEX\_FOLLOW) → `['index', 'follow']`
    - etc.
- `https_meta_robots` setting
- `paginated_robots_type` setting
- All URL patterns and priorities preserved

**No Manual Steps Required** - Simply run `setup:upgrade`

### Breaking Changes

[](#breaking-changes)

1. **API Changes**: `RobotsListInterface::getMetaRobotsByCode()` deprecated (still works)
2. **Return Types**: `getHttpsMetaRobots()` and `getPaginatedMetaRobots()` now return arrays instead of integers
3. **Configuration Format**: Stored as directive arrays instead of integer codes

API Usage
---------

[](#api-usage)

### Building Robots String from Directives

[](#building-robots-string-from-directives)

```
use Hryvinskyi\SeoRobotsApi\Api\RobotsListInterface;

class YourClass
{
    private $robotsList;

    public function __construct(RobotsListInterface $robotsList)
    {
        $this->robotsList = $robotsList;
    }

    public function example()
    {
        // Build robots string from directive array
        $directives = ['noindex', 'follow', 'noarchive'];
        $robotsString = $this->robotsList->buildMetaRobotsFromDirectives($directives);
        // Result: "NOINDEX,FOLLOW,NOARCHIVE"
    }
}
```

### Validating Directives

[](#validating-directives)

```
// Validate directive array for conflicts
$directives = ['index', 'noindex']; // Conflicting!
$validation = $this->robotsList->validateDirectives($directives);

if (!$validation['valid']) {
    foreach ($validation['errors'] as $error) {
        // Handle error: "Conflicting directives: index and noindex cannot be used together"
    }
}
```

### Getting Available Directives

[](#getting-available-directives)

```
// Get all basic directives
$basicDirectives = $this->robotsList->getBasicDirectives();
// Returns: ['index', 'noindex', 'follow', 'nofollow', 'noarchive', ...]

// Get advanced directives
$advancedDirectives = $this->robotsList->getAdvancedDirectives();
// Returns: ['max-snippet', 'max-image-preview', ...]
```

Extension Points
----------------

[](#extension-points)

### Custom Robots Providers

[](#custom-robots-providers)

Implement `RobotsProviderInterface` to provide custom robots logic:

```
namespace Vendor\Module\Model;

use Hryvinskyi\SeoRobotsFrontend\Model\RobotsProviderInterface;
use Magento\Framework\App\RequestInterface as HttpRequestInterface;

class CustomRobotsProvider implements RobotsProviderInterface
{
    public function getRobots(HttpRequestInterface $request): ?string
    {
        // Your custom logic
        if ($request->getParam('custom_param')) {
            return 'NOINDEX,FOLLOW';
        }
        return null;
    }

    public function getSortOrder(): int
    {
        return 100; // Execution order
    }
}
```

Register in `di.xml`:

```

            Vendor\Module\Model\CustomRobotsProvider

```

Requirements
------------

[](#requirements)

- PHP 8.1, 8.2, or 8.3
- Magento 2.4.x
- Composer

Troubleshooting
---------------

[](#troubleshooting)

### Configuration Not Applying

[](#configuration-not-applying)

1. Clear Magento cache: `php bin/magento cache:flush`
2. Verify module is enabled: `php bin/magento module:status`
3. Check pattern matching - use action names instead of URL paths
4. Verify priority - higher priority rules override lower ones

### Migration Issues

[](#migration-issues)

If automatic migration fails:

1. Backup your configuration: `app/etc/config.php`
2. Manually convert using the code-to-directive mapping in CHANGELOG.md
3. Report issue at:

### Directive Conflicts

[](#directive-conflicts)

Valid combinations:

- ✅ noindex, follow
- ✅ index, nofollow, noarchive
- ❌ index, noindex (conflicting)
- ❌ follow, nofollow (conflicting)

Support
-------

[](#support)

- Report issues:
- Email:

Author
------

[](#author)

**Volodymyr Hryvinskyi**

- Email:
- Website:

License
-------

[](#license)

MIT License - see LICENSE file for details

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for detailed version history.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance80

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~149 days

Recently: every ~27 days

Total

11

Last Release

107d ago

Major Versions

1.0.7 → 2.0.02026-01-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/e254b6c28f67e639b2beb3f21a80f2b4ff9efc5ee782943d497b73523f630c1d?d=identicon)[hryvinskyi](/maintainers/hryvinskyi)

---

Top Contributors

[![hryvinskyi](https://avatars.githubusercontent.com/u/9294098?v=4)](https://github.com/hryvinskyi "hryvinskyi (14 commits)")

### Embed Badge

![Health badge](/badges/hryvinskyi-magento2-seo-robots-pack/health.svg)

```
[![Health](https://phpackages.com/badges/hryvinskyi-magento2-seo-robots-pack/health.svg)](https://phpackages.com/packages/hryvinskyi-magento2-seo-robots-pack)
```

###  Alternatives

[fastly/magento2

Fastly CDN Module for Magento 2.4.x

1564.2M1](/packages/fastly-magento2)[mage-os/module-automatic-translation

Automatic AI content translation for Mage-OS.

277.1k](/packages/mage-os-module-automatic-translation)[zepgram/module-rest

Technical module to industrialize API REST call with dependency injection pattern using Guzzle library

1326.2k](/packages/zepgram-module-rest)[graycore/magento2-graphql-introspection-cache

1015.2k](/packages/graycore-magento2-graphql-introspection-cache)[mage-os/mageos-common-async-events

Send REST requests to external endpoints asynchronously. This module implements the most common events like order creation and customer change.

147.7k2](/packages/mage-os-mageos-common-async-events)[mage-os/module-inventory-reservations-grid

Add a grid with the list of inventory reservations.

126.8k](/packages/mage-os-module-inventory-reservations-grid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
