WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 2 months ago

#46918 closed defect (bug) (invalid)

Link Modal Dialog of Editor adds H1-tag to site

Reported by: Asgaros Owned by:
Milestone: Priority: normal
Severity: minor Version: 4.5
Component: Editor Keywords: has-patch
Focuses: accessibility Cc:

Description

Hello everyone,

if the WordPress-editor is used on the front-end by calling the wp_editor() function (e.g. for the comments-area or somewhere else inside a plugin), a H1 headline-tag is added to the end of the HTML-sourcecode.

This tag is part of the editors modal-dialog for inserting/editing a link as shown in the following image:

https://i.imgur.com/lq0p2kP.png

The modal-dialog is hidden by default and only visible when editing a link. The H1 headline-tag gets generated inside the wp_link_dialog() function of the _WP_Editors class.

I use the WordPress-editor inside my Asgaros Forum-plugin and got a couple of reports from users about this issue in the past (examples: 1, 2). The main concern is that multiple H1 headline-tags may have a negative impact in regards to SEO.

In my oppinion there is no good reason for using a H1 headline-tag for the title of this modal-dialog because it is not related to the content of the page. As an alternative a DIV-tag could be used instead to solve this issue.

Attachments (1)

46918.patch (797 bytes) - added by Asgaros 4 months ago.

Download all attachments as: .zip

Change History (7)

@Asgaros
4 months ago

#1 @SergeyBiryukov
4 months ago

  • Focuses accessibility added
  • Version changed from trunk to 4.5

Introduced in [36991].

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


4 months ago

#3 @afercia
4 months ago

  • Keywords reporter-feedback added

Discussed during today's accessibility bug-scrub. Most of the modals in WordPress use a h1, including the Gutenberg ones. That’s a pretty common pattern for modals because when the modal opens, its content is supposed to be the only perceivable content in a page. Omitting the heading would be equivalent to put content in a page without headings.

Granted, the WordPress modals need many more improvements :) For reference, here's an example from the W3C: https://www.w3.org/TR/wai-aria-practices-1.1/examples/dialog-modal/dialog.html

@Asgaros we're not sure we understand the concern here. The heading is hidden, search engine crawlers should just ignore it. Do you have data or other evidence the hidden heading is causing problems for SEO?

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


3 months ago

#5 @afercia
3 months ago

  • Keywords close added

#6 @desrosj
2 months ago

  • Keywords reporter-feedback close removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

I'm going to close this one out due to lack of reporter feedback. @Asgaros if you are able to provide more details to clarify, please do reopen.

Note: See TracTickets for help on using tickets.