Created
December 7, 2020 16:20
-
-
Save ashhitch/ace16e2fd3a57116eed2074f579db5ba to your computer and use it in GitHub Desktop.
remove search action Yoast SEO
This file contains 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