Archived topic
Skip To COntent
14 replies · Started by Praveen on March 8, 2021
Hi guys,
On some pages and sometimes I see "Skip to content" written at top left of mobile. When I refresh it goes.
Today I saw it in the URL attached, but after refreshing its gone.
I am not sure what is causing it.
Hi there,
It's the screen-reader-text skip-link. It's for keyboard navigation.
https://make.wordpress.org/accessibility/handbook/markup/the-css-class-screen-reader-text/
It appears when you press tab. :)
Hi,
two things -
1. It appeared on mobile - where I cannot press Tab
2. Appeared on Google console Live testing of the same URL - where again, I cannot press a tab!
I checked it on mobile as well and I didn't encounter this at all.
The same goes with Google PSI and Lighthouse.
I've also checked the CSS and I believe it's CSS being cached and loading a bit later than it should've might've something to do on why it appeared briefly.
It's not good practice but if you must remove this, here's the PHP snippet to do it:
add_action( 'after_setup_theme', function() {
remove_action( 'generate_before_header', 'generate_do_skip_to_content_link', 2 );
}, 50 );
Hi,
Appreciate your help.
I will take a snapshot of this when it happens next time.
Can it be a cache-related issue?
Will removing this have any SEO-related issue?
Can it be a cache-related issue?
It can be, as it's related to how the CSS related to the screen-reader-text skip-link is being served.
Will removing this have any SEO-related issue?
I'm not exactly sure but It's not good practice to remove it as it's added for accessibility.
Thanks! got it.
How can I add images / attachments ? I was checking pagespeed and same error came at many places
How can I add images / attachments ? I was checking pagespeed and same error came at many places
To add to reply? If you need to upload screenshots for explanations, you can use a cloud service like Postimages or Imgur.
Here it is.
Can this be because of Asset Clean Up plugin?
Hi there,
try disabling that plugin, and clear any caches - you can then eliminate that as the cause.
The code is actually on your site template https://gpsites.co/search/
My SEO plugin is picking it up a broken link to "#content" that's how I spotted the same thing
Not sure if I fully understand.
Can you explain a bit more?
There isn't anything special about the Search template.
Sorry Leo, ignore me, I'm being stupid haha. Feel free to delete my comment
No problem :)