Archived topic
Aria attributes do not match their roles
7 replies · Started by Kelsey on March 2, 2023
Hello, I am getting this accessibility message on PageSpeed Insights for my category pages.
Aria attributes do not match their roles
Entry meta
<footer class="entry-meta" aria-label="Entry meta">
How can I fix it? And why is it only happening on my category pages?
Hi Kelsey,
Can you try this PHP code:
add_action('wp',function() {
if (is_archive()) {
remove_action( 'generate_after_entry_content', 'generate_footer_meta' );
}
});
Adding PHP: https://docs.generatepress.com/article/adding-php/
It won't let me add it (an exclamation point shows up next to the fourth line).
I have also never used Code Snippets before, what do I set the location to? Thanks!
Ying function shows no error for me:
https://www.screencast.com/t/nulh2ZrQN
Can you make sure to copy and entire thing?
I tried it again but this is the message I keep getting:
rule 934100 - reason Node.js Injection Attack Matched Data: function() { found within args:snippet_code: add_action('wp',function() {\r\n\tif (is_archive()) {\r\n\t\tremove_action( 'generate_after_entry_content', 'generate_footer_meta' );\r\n\t }\r\n});
Hi there,
that looks a security plugin or setting on your server that is blocking that function.
For now don't use that snippet.
Go to Customizer > Additional CSS and add this CSS:
.archive .entry-meta {
display: none;
}
Thank you, it worked!
Glad to hear that!