WordPress.org

Making WordPress.org

Opened 3 months ago

Closed 5 weeks ago

Last modified 5 weeks ago

#4276 closed defect (fixed)

Remove JavaScript title update on theme pages

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

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 3 months ago.
Screenshot_20190325-091752_Google.jpg (411.8 KB) - added by williampatton 3 months ago.

Download all attachments as: .zip

Change History (15)

#1 @jonoaldersonwp
3 months ago

  • Description modified (diff)

#2 @williampatton
3 months 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
3 months ago

#4103 was marked as a duplicate.

#4 @atanasangelovdev
3 months 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 3 months ago by atanasangelovdev (previous) (diff)

#5 @williampatton
3 months 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 3 months ago by williampatton (previous) (diff)

#6 @jonoaldersonwp
3 months ago

  • Description modified (diff)

#7 @atanasangelovdev
3 months ago

@jonoaldersonwp any feedback on the patch?

#8 @jonoaldersonwp
2 months 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.


7 weeks ago

#10 @tellyworth
7 weeks ago

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

#11 @tellyworth
5 weeks 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 weeks 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 weeks ago

Note: See TracTickets for help on using tickets.