-
-
Save Shoora/bea834f5ce5eba374a7f0c736395e8a5 to your computer and use it in GitHub Desktop.
remove search action Yoast SEO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('wpseo_schema_website', 'example_change_website'); | |
function example_change_website($data) | |
{ | |
if ($data['potentialAction']) { | |
foreach ($data['potentialAction'] as $key => $value) { | |
# code... | |
if ($value['@type'] && $value['@type'] == 'SearchAction') { | |
unset($data['potentialAction'][$key]); | |
} | |
} | |
} | |
return $data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment