PHPackages                             buten/module-guest-restriction - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. buten/module-guest-restriction

ActiveMagento2-module[Authentication &amp; Authorization](/categories/authentication)

buten/module-guest-restriction
==============================

Magento 2 module that restricts access or visibility for guest users.

1.0.0(6mo ago)04MITPHPPHP &gt;=8.1

Since Oct 30Pushed 6mo agoCompare

[ Source](https://github.com/pbuten/m2-guest-restriction)[ Packagist](https://packagist.org/packages/buten/module-guest-restriction)[ RSS](/packages/buten-module-guest-restriction/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Buten\_GuestRestriction
=======================

[](#buten_guestrestriction)

**Buten\_GuestRestriction** is a lightweight Magento 2 module designed to **restrict access and hide specific frontend content for guest (not logged-in) users**.
It helps store owners ensure that certain features, blocks, or pages are visible only to authenticated customers - improving user flow and protecting restricted content.

---

🧩 Features
----------

[](#-features)

- 🚫 Hide or disable layout blocks for guest users.
- ⚙️ Configurable from the Magento Admin panel.
- 🧩 Compatible with both Magento Open Source and Adobe Commerce.
- 🧩 Lightweight - no database schema changes or UI components added.

---

🏗️ Module Structure
-------------------

[](#️-module-structure)

```
Buten/GuestRestriction
├── etc/
│   ├── adminhtml/system.xml       # Admin configuration settings
│   ├── config.xml                 # Default configuration values
│   ├── frontend/di.xml            # Dependency Injection for frontend
│   ├── frontend/events.xml        # Observers for frontend area
│   └── module.xml                 # Module declaration
├── Helper/ConfigHelper.php        # Fetch configuration values
├── Observer/RemoveBlocksObserver.php # Removes restricted blocks for guests
├── Plugin/RestrictPlugin.php      # Plugin logic for restriction
├── registration.php               # Registers the module with Magento

```

---

⚙️ Installation
---------------

[](#️-installation)

### Option 1: Install via Composer (recommended)

[](#option-1-install-via-composer-recommended)

If the module is published on Packagist or your VCS repository:

```
composer require buten/module-guest-restriction
bin/magento module:enable Buten_GuestRestriction
bin/magento setup:upgrade
bin/magento cache:flush
```

### Option 2: Manual installation

[](#option-2-manual-installation)

1. Copy this module to: ```
    app/code/Buten/GuestRestriction

    ```
2. Enable and upgrade: ```
    bin/magento module:enable Buten_GuestRestriction
    bin/magento setup:upgrade
    bin/magento cache:flush
    ```

---

🔧 Configuration
---------------

[](#-configuration)

Navigate to:

> **Admin Panel → Stores → Settings → Configuration → Buten → Guest Restriction**

\*Select scope if required.

### Available Settings

[](#available-settings)

SettingDescription**Enabled**Turn guest restriction on or off (redirects guests to the login page)**Allowed pages**Specify the list of pages allowed for guests**Remove blocks**(Optional) Turn blocks removal on or off**Blocks to be removed**(Optional) Specify the list of block names to be removed---

🧩 Compatibility
---------------

[](#-compatibility)

Magento VersionSupportedMagento Open Source &gt;= 2.4.4✅Adobe Commerce &gt;= 2.4.4✅PHP &gt;= 8.1✅---

🧩 Technical Details
-------------------

[](#-technical-details)

- **Area:** Frontend only
- **Depends on:** `Magento_Customer`, `Magento_Store`
- **Entry Points:** Observers &amp; Plugins
- **Data Storage:** Uses configuration only (no DB tables)

---

👨‍💻 Developer
-------------

[](#‍-developer)

**Author:** Pavlo Butenko
**GitHub:**
**Email:**

If you find this module useful, please ⭐ star the repository!

---

📄 License
---------

[](#-license)

This module is licensed under the [MIT License](LICENSE.txt).
You’re free to use, modify, and distribute it in commercial or open-source projects as long as you retain the copyright notice.

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance72

Regular maintenance activity

Popularity5

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

191d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/27a691c39230a2379465aa0d1abdfd22281a7634e3ff86c417b9b8c97d1d2967?d=identicon)[buten](/maintainers/buten)

### Embed Badge

![Health badge](/badges/buten-module-guest-restriction/health.svg)

```
[![Health](https://phpackages.com/badges/buten-module-guest-restriction/health.svg)](https://phpackages.com/packages/buten-module-guest-restriction)
```

###  Alternatives

[bitexpert/magento2-force-customer-login

The Force Login module for Magento2 redirects a storefront visitor to the Magento2 Frontend login page, if the visitor is not logged in. It is possible to configure the whitelisted urls to add custom definitions.

171409.9k](/packages/bitexpert-magento2-force-customer-login)[dotdigital/dotdigital-magento2-extension

Dotdigital for Magento 2

50374.2k18](/packages/dotdigital-dotdigital-magento2-extension)[swissup/module-search-mysql-legacy

Legacy mysql search for magento 2.4

10483.0k](/packages/swissup-module-search-mysql-legacy)[hryvinskyi/magento2-invisible-captcha

Magento 2 Google Invisible Captcha (Recaptcha) module

279.4k](/packages/hryvinskyi-magento2-invisible-captcha)[mage-os/module-inventory-reservations-grid

Add a grid with the list of inventory reservations.

126.8k](/packages/mage-os-module-inventory-reservations-grid)[loki/magento2-admin-components

N/A

151.6k5](/packages/loki-magento2-admin-components)

PHPackages © 2026

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