Make WordPress Core

Opened 15 months ago

Last modified 15 months ago

#57922 new enhancement

Changing class-wp-editor.php Insert/Edit Link header from H1 to H3 or other

Reported by: donniewalden707's profile donniewalden707 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.1.1
Component: Editor Keywords: reporter-feedback
Focuses: ui Cc:

Description

Hey there!

I am using the wordpress core feature of having a blog page host all our posts. There is a modal in the class-wp-editor.php file located in the wp-includes directory.

On line 1868 (or around there) a modal is shown with the title "Insert/edit link". This line is wrapped in an H1 which from an SEO standpoint is really unfortunate as google sees that as a title for the page. Even if you put an additional H1 on the page above the modal, google will still see it as the title of the page. And in our case that's every paginated blog page. I think it would be really beneficial for everyone to change that header to an h3 or lower. H2 is fine as well but I don't think it requires that level.

Thank you!

All the best,
D

Change History (5)

#1 @costdev
15 months ago

  • Component changed from Posts, Post Types to Editor
  • Keywords reporter-feedback added

Hi @donniewalden707, welcome to Trac and thanks for opening this ticket!

So that we can reproduce this issue, can you provide the steps needed to set up the blog page to hosts your posts, and any other steps neccesary to produce this issue? This helps us to identify the cause faster. 🙂

In addition:

  • What theme does your site use? If it's a custom theme, is it a block theme, or a classic (PHP) theme?
  • What plugins does your site use?

Thanks!

#2 @donniewalden707
15 months ago

Hey there!

Thanks for getting back :)

We have a ton of plugins (nearing 80) because we run a large e-commerce membership learning site with a ton of features. But the one's you probably need to know are:

Buddypress
Memberium
Learndash
Woocommerce
Elementor & Pro

Blog page is built with Elementor.

Theme is custom but built off Genesis as the parent. It's block-based I believe.

The blog page is an elementor template archive page that is then selected in the WordPress general settings under the reading I believe.

But the code I'm referencing is just in wp-includes/class-wp-editor.php which I believe is a WordPress core file? Unless it is placed there by another plugin I'm not entirely sure. But that was my understanding. So I would think you should be able to see the h1 header in that code there in a new installation even.

Let me know what other info you need or any ways I can help!

D

#3 @audrasjb
15 months ago

Hello and welcome to WordPress Core Trac @donniewalden707!

I guess you're referring to this line in WordPress Core?

In this case, it's hard to imagine how this would affect the search engine optimization (SEO) of your site, since it is not meant to be used on public-facing screens.

But maybe you're using the block editor on the front-end of your website? And perhaps via the Blocks Everywhere plugin? This information is very important to better understand the issue :)

#4 @donniewalden707
15 months ago

Hey @audrasjb that's correct.

While the code has a style of display:none - googles crawlers can still index that page and see that modal code. So it sees <h1> "Insert/edit link" </h1> as a leading title on the page and then tries to place it as useful information on the search. I've manually changed it to an h3, and it's fixed the issue.

Just figured someone should know since it seems like a weird place to use an h1 tag. Not to mention I'll need to manually change it next core update most likely. We really shouldn't ever use H1 anywhere on a page if it's not the actual title of the page. I get it from the standpoint of the modal as a stand-alone object, but since the modal only ever features on the page and it's hidden by default, makes more sense to give it an H2 or an H3 if a title is needed. Crawlers are going to see it regardless, in the HTML, if it's hidden or not via styles.

As for plugins - we are not using blocks everywhere plugin :)

All the best,
D

#5 @audrasjb
15 months ago

Ok. Many thanks for providing more details!

Still, a fresh WordPress installation doesn't add this dialog box on front-end (even in hidden mode via display: none). I try to figure out whether this should be "fixed" by Core or in the plugin that is adding it on the front-end of your website.

Do you have a link to an example page? Or if you don't want to share a link to your website to avoid this thread to be indexed by search engines (you can still copy the link and replace some characters, etc), could you please try to identify the plugin that is inserting this code to your page?

Note: See TracTickets for help on using tickets.