Stop WordPress printing a block of inline CSS in the page head for the classic Recent Comments widget.
add_filter( 'show_recent_comments_widget_style', '__return_false' );
Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.
When the classic Recent Comments widget is active, WordPress prints a small style block in the head of every page to fix an old layout quirk. Most themes style the widget themselves, so it’s redundant.
WordPress checks show_recent_comments_widget_style before printing the .recentcomments a style. Returning false skips it.
View the page source and search for .recentcomments a. It should be gone.
This website uses cookies to make it work and to understand how it is used. Some cookies are strictly necessary for the site to function and cannot be switched off. Others help us analyse how visitors use the site using our self-hosted analytics tools.
We use Plausible Analytics, which sets no cookies and collects no personal data. We also use Matomo Analytics, which sets cookies only if you choose to accept them. Both tools run entirely on our own servers and no data is shared with any third party. We do not use advertising or social media cookies.
If you are under 16 years old, please make sure you have your parent or guardian's permission before accepting any non-essential cookies.
You can accept all cookies, decline non-essential cookies, or adjust your preferences at any time by clicking Cookie Settings in the footer of this site. For full details on every cookie we use, read our Cookie Policy. For information on how we handle your data, read our Privacy Policy.
Declining analytics cookies will not affect your ability to use this site.
Some required resources have been blocked, which can affect third-party services and may cause the site to not function properly.
This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.