Skip to content

Instantly share code, notes, and snippets.

@tacoverdo
Last active June 19, 2019 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tacoverdo/3e9fec24ebcf33abb111 to your computer and use it in GitHub Desktop.
Save tacoverdo/3e9fec24ebcf33abb111 to your computer and use it in GitHub Desktop.
change_url_googles_ssb.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/**
* Changes the URL used for the Google Sitelink Search Box functionality in WordPress SEO (Premium)
* The returned string must always include {search_term} to indicate where the search term should be used.
*
* @returns string new searchURL
*/
function yoast_change_ssb_search() {
return 'http://mysite.com/?search={search_term_string}';
}
add_filter('wpseo_json_ld_search_url', 'yoast_change_ssb_search' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment