Hi @unrealnfs,
Please try this code snippet.
/**
* Remove unnecessary generator tags from wp_head
*/
function geobuddy_remove_generator_tags() {
// Check if the classes exist before attempting to remove actions
if ( class_exists( 'WP_Font_Awesome_Settings' ) ) {
$fa_instance = WP_Font_Awesome_Settings::instance();
remove_action( 'wp_head', array( $fa_instance, 'add_generator' ), 99 );
}
if ( class_exists( 'WP_Super_Duper' ) ) {
global $wp_super_duper;
if ( $wp_super_duper instanceof WP_Super_Duper ) {
remove_action( 'wp_head', array( $wp_super_duper, 'generator' ), 99 );
}
}
}
add_action( 'init', 'geobuddy_remove_generator_tags', 20 );
Regards
Hi @1naveengiri
I have watched your YouTube Tutorials and i liked them all. Glad to see you here in the support.
I tried the above PHP code-snippet – i used WPcode plugin.
One part worked, other one didn’t.
This below one did not work and its still shows in the frontend.
<meta name="generator" content="WP Super Duper v1.2.18" data-sd-source="geodirectory" />
Thanks.
Hi @unrealnfs,
Thanks for your kind words.
Try this updated code snippet, let me know how it goes.
/**
* Remove unnecessary generator tags from wp_head
*/
function geobuddy_remove_generator_tags() {
// Check if the classes exist before attempting to remove actions
if ( class_exists( 'WP_Font_Awesome_Settings' ) ) {
$fa_instance = WP_Font_Awesome_Settings::instance();
remove_action( 'wp_head', array( $fa_instance, 'add_generator' ), 99 );
}
}
add_action( 'init', 'geobuddy_remove_generator_tags', 20 );
function remove_super_duper_generator_via_widget_init( $options, $instance ) {
remove_action( 'wp_head', array( $instance, 'generator' ), 99 );
}
add_action( 'wp_super_duper_widget_init', 'remove_super_duper_generator_via_widget_init', 10, 2 );
Regards
That’s Fabulous – It Works!
God bless.
Have a great day.