im found;
remove_filter( 'wp_footer', array( EDD()->structured_data, 'output_structured_data' ) );
thank you 🙂
The last piece of code caused a critical error. How can we solve this?
Call to undefined function EDD() …
Hi there.
Can you provide the entire error message here? Use the CODE tags before adding the error message in the reply box.
Hi @misulicus ;
Error Image
The problem seems to be that the EDD function is undefined.
Line 43 contains the updated code I added.
-
This reply was modified 3 years, 3 months ago by
bilgi25.
-
This reply was modified 3 years, 3 months ago by
bilgi25.
@bilgi25 That means you are placing it in a location that is loading too early to load. The theme’s functions.php has typically loaded before all the plugins are loaded.
You would need to wrap that in a function to hook into something later in the page load like init, and it’s always good to put protection around it as well to ensure that the function exists.
function bilgi25_remove_structured_data() {
if ( ! function_exists( 'EDD' ) ) {
return;
}
remove_filter( 'wp_footer', array( EDD()->structured_data, 'output_structured_data' ) );
}
add_action( 'init', 'bilgi25_remove_structured_data' );