Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#4276 closed defect (bug) (fixed)

Remove JavaScript title update on theme pages

Reported by: jonoaldersonwp's profile jonoaldersonwp Owned by: ck3lee's profile ck3lee
Milestone: Priority: high
Component: Theme Directory Keywords: seo

Description (last modified by jonoaldersonwp)

When pages like load, JavaScript is used to alter the page title from Twenty Nineteen - WordPress theme | to {{theme name}} | 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 |

Attachments (2)

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

Download all attachments as: .zip

Change History (15)

#1 @jonoaldersonwp
5 years ago

  • Description modified (diff)

#2 @williampatton
5 years 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
5 years ago

#4103 was marked as a duplicate.

#4 @atanasangelovdev
5 years 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 |', '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 5 years ago by atanasangelovdev (previous) (diff)

#5 @williampatton
5 years ago

Added screenshot of the problematic titles that Google sees and adds in my feed. The page linked in the screenshot is

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

#6 @jonoaldersonwp
5 years ago

  • Description modified (diff)

#7 @atanasangelovdev
5 years ago

@jonoaldersonwp any feedback on the patch?

#8 @jonoaldersonwp
5 years ago

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

This ticket was mentioned in Slack in #meta by tellyworth. View the logs.

5 years ago

#10 @tellyworth
5 years ago

  • Owner set to ck3lee
  • Status changed from new to reviewing

#11 @tellyworth
5 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 8795:

Theme directory: improve title switching on theme pages.

Props atanasangelovdev.
Fixes #4276

#12 @tellyworth
5 years ago

In 8796:

Theme directory: bump cache for [8795]

See #4276

This ticket was mentioned in Slack in #meta by tellyworth. View the logs.

5 years ago

Note: See TracTickets for help on using tickets.