Search by

infrangible / m2-cms-block-meta-data

infrangible

Adds meta title, meta keywords and meta description fields to CMS blocks and applies them to the page on which the block is shown as a widget.

Package info

github.com/infrangible-dev/m2-cms-block-meta-data

Homepage

Type:magento2-module

pkg:composer/infrangible/m2-cms-block-meta-data

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

2.0.0 2026-12-01 14:49 UTC

This package is auto-updated.

Last update: 2026-12-01 14:51:33 UTC


README

Adds meta title, meta keywords and meta description fields to CMS blocks and applies them to the page on which the block is shown with the widget "CMS Static Block".

Behavior

Magento keeps meta data for CMS pages, products and categories, but not for CMS blocks. If a page is built from a block, for example a landing page that only shows a block through a widget, its title and meta tags could not be maintained in the block.

  • The CMS block form (Content > Elements > Blocks) gets the section "Search Engine Optimization" with the fields "Meta Title", "Meta Keywords" and "Meta Description".
  • When a page shows an active block with the widget "CMS Static Block", the filled fields of the block replace the title, meta keywords and meta description of the page. Empty fields keep the values of the page. The visible heading of the page stays as it is.
  • This works for widgets in the content of CMS pages (inserted with "Insert Widget") and for widget instances (Content > Elements > Widgets) on any page.
  • Blocks are loaded like the widget loads them: by ID or identifier, for the current store view, only if active.
  • If a page shows several blocks with meta data, the values of the last one win.
  • Blocks inside other blocks, blocks placed by the theme layout and blocks in category descriptions are not taken into account.

Requirements

  • Magento Open Source or Adobe Commerce 2.4.6 or newer
  • PHP 8.1 or newer

Installation

composer require infrangible/m2-cms-block-meta-data
bin/magento module:enable Infrangible_CmsBlockMetaData
bin/magento setup:upgrade

In production mode, also run bin/magento setup:di:compile.

The fields are the columns meta_title, meta_keywords and meta_description of the table cms_block.

License

Infrangible CMS Block Meta Data is licensed under the MIT License - see the LICENSE file for details.