Skip to content

Prefix webmention_canonical_url meta key with underscore#598

Draft
pfefferle wants to merge 2 commits intomainfrom
fix/493-prefix-meta-key
Draft

Prefix webmention_canonical_url meta key with underscore#598
pfefferle wants to merge 2 commits intomainfrom
fix/493-prefix-meta-key

Conversation

@pfefferle
Copy link
Copy Markdown
Owner

Summary

  • Renames webmention_canonical_url post meta key to _webmention_canonical_url so it is hidden from the Custom Fields UI dropdown (meta keys prefixed with _ are treated as internal by WordPress)
  • Adds a reusable update_postmeta_key helper method to the Upgrade class
  • Adds a database migration (1.0.2) that renames the meta key for existing entries

Fixes #493

Test plan

  • Verify that new posts trashed after the update store the canonical URL under _webmention_canonical_url
  • Verify that the meta key no longer appears in the Custom Fields dropdown on the post editor
  • Verify that the migration renames existing webmention_canonical_url entries in wp_postmeta to _webmention_canonical_url
  • Verify that delete webmentions still work correctly for trashed posts (the source URL is retrieved from the prefixed meta key)

Rename `webmention_canonical_url` to `_webmention_canonical_url` so
it does not appear in the Custom Fields UI dropdown. Meta keys
prefixed with an underscore are treated as hidden/internal by
WordPress.

Adds a database migration (1.0.2) that renames the meta key for
existing entries using the new `update_postmeta_key` helper.

Fixes #493
@pfefferle pfefferle marked this pull request as draft March 30, 2026 18:05
Rename migrate_to_1_0_2 to migrate_to_5_7_0 to match the plugin
versioning scheme used by the upgrade system.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prefix meta key with underscore

1 participant