Making WordPress.org

Opened 6 weeks ago

Last modified 3 weeks ago

#4276 new defect

Remove JavaScript title update on theme pages

Reported by: jonoaldersonwp Owned by:
Milestone: Priority: high
Component: Theme Directory Keywords: seo

Description (last modified by jonoaldersonwp)

When pages like https://wordpress.org/themes/twentynineteen/ load, JavaScript is used to alter the page title from Twenty Nineteen - WordPress theme | WordPress.org to {{theme name}} | WordPress.org. This should be disabled on load.

When using JavaScript to navigate between themes (e.g., via the next/prev arrows), the title should be updated, but using the correct format ({{theme name}} - WordPress theme | WordPress.org)

Attachments (2)

4276.diff (2.3 KB) - added by atanasangelovdev 6 weeks ago.
Screenshot_20190325-091752_Google.jpg (411.8 KB) - added by williampatton 5 weeks ago.

Download all attachments as: .zip

Change History (10)

#1 @jonoaldersonwp
6 weeks ago

  • Description modified (diff)

#2 @williampatton
6 weeks ago

I have seen strangeness occur because of this JavaScript. In my Google Now/Discover feed I often see misformed titles when they are highlighting certain themes for me.

In my case it tends to start More info... but I'm not able to see why it would be the case that Google considers that to be the title.

I'll add a screenshot next time this misformed titke pops into my feed again.

#3 @jonoaldersonwp
6 weeks ago

#4103 was marked as a duplicate.

#4 @atanasangelovdev
6 weeks ago

Attached my proposed patch. I'm concatenating two translation strings that already exist which is usually a no-no but I guess is somewhat fine in this particular case as they are already fragmented in document_title_parts. It may be simpler to just introduce a new one though:

__( '%s - WordPress theme | WordPress.org', 'wporg-themes' )

This should be disabled on load.

I did a comparison with the current title which will match on first load and if the titles don't match the new one should be applied in any case anyway.

Any feedback will be appreciated.

Last edited 6 weeks ago by atanasangelovdev (previous) (diff)

#5 @williampatton
5 weeks ago

Added screenshot of the problematic titles that Google sees and adds in my feed. The page linked in the screenshot is https://wordpress.org/themes/bizlite-business/

Last edited 5 weeks ago by williampatton (previous) (diff)

#6 @jonoaldersonwp
3 weeks ago

  • Description modified (diff)

#7 @atanasangelovdev
3 weeks ago

@jonoaldersonwp any feedback on the patch?

#8 @jonoaldersonwp
3 weeks ago

Looks sensible, though a little out of my depth. Maybe somebody smart like @coffee2code or @SergeyBiryukov could take a look? :)

Note: See TracTickets for help on using tickets.