Remove Inline Hardcoded Recent Comments Sidebar Widget Style

Maybe you want to customize your Recent Comments Sidebar widget manually. But you will notice some inline CSS. These inline CSS will cause a problem, while you try to design this widget yourself. 

Here is a quick solution which gonna help you to remove all inline hardcoded recent comments sidebar widget CSS.

Login to your Cpanel or FTP and edit the function.php file. Paste the following code inside your function.php file. 

					// Remove styles for .recentcomments
global $wp_widget_factory;
remove_action('wp_head', array($wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style'));

This code will remove all Hardcoded inline CSS from the recent comments widget. 

If you face problem while doing this via coding, you can simply remove this inline hardcoded CSS using WP Adminify plugin. After proper activation, you have to navigate WP Adminify > Tweaks > Head option. Scroll down to bottom and you will see Remove Hardcoded Styles for Recent Comments option. Just enable it using the switcher and you are done.

Remove Hardcoded Styles for Recent Comments
August 28, 2021
Head Tips and Tutorials
Was this article helpful?

© 2021-2024 - Adminify | All rights reserved

WP Adminfy accepted payment methods