Skip to content

Remove propagation of site description metadata to all pages - #787

Merged
giuscris merged 1 commit into
2.xfrom
fix/remove-unintended-page-metadata
Nov 16, 2025
Merged

Remove propagation of site description metadata to all pages#787
giuscris merged 1 commit into
2.xfrom
fix/remove-unintended-page-metadata

Conversation

@giuscris

Copy link
Copy Markdown
Member

This pull request removes the propagation of site description field as a <meta name="description"> to all pages, with the unintended result of potentially compromising search engine results with an identical description for each indexed page.

The pull request also removes the propagation of site author field if present, which would result in the propagation of an author metadata identical for all pages.

The benefit of this change is higher than the risk of changing the previous behavior.

Metadata handling improvements:

  • The generator metadata field in Site.php is now conditionally set based on the system.metadata.setGenerator configuration value directly when building the defaults, eliminating redundant logic and making the code more concise.

Codebase cleanup:

  • The ReadonlyModelProperty attribute was removed from the metadata property in the Page class, possibly to allow for future modifications or to align with updated property handling conventions.

@giuscris giuscris added this to the 2.2.0 milestone Nov 16, 2025
@giuscris
giuscris requested a review from Copilot November 16, 2025 10:03
@giuscris giuscris self-assigned this Nov 16, 2025
@giuscris giuscris added bug Something isn't working enhancement New feature or request labels Nov 16, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves metadata handling by removing the propagation of site-wide description and author metadata to all pages, preventing potential SEO issues from duplicate metadata. It also streamlines the generator metadata logic.

  • Removes site-level author and description from default metadata to prevent identical metadata across all pages
  • Simplifies generator metadata handling with inline conditional logic
  • Makes Page metadata property writable by removing ReadonlyModelProperty attribute

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
formwork/src/Cms/Site.php Removes author and description from default site metadata and streamlines generator metadata logic using ternary operator
formwork/src/Pages/Page.php Removes ReadonlyModelProperty attribute from metadata property to allow modifications via the set() method

馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@giuscris
giuscris marked this pull request as ready for review November 16, 2025 11:34
@giuscris
giuscris merged commit cf8c28f into 2.x Nov 16, 2025
7 checks passed
@giuscris
giuscris deleted the fix/remove-unintended-page-metadata branch November 16, 2025 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants