Skip to content

Instantly share code, notes, and snippets.

@Tabrisrp
Last active July 9, 2018 15:04
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tabrisrp/ca210e27285390dddd03205543ad2b2d to your computer and use it in GitHub Desktop.
Save Tabrisrp/ca210e27285390dddd03205543ad2b2d to your computer and use it in GitHub Desktop.
add_filter( 'rocket_cache_reject_ua', 'wprocket_remove_fb_ua' );
function wprocket_remove_fb_ua( $ua ) {
if ( in_array( 'facebookexternalhit', $ua ) ) {
$ua = array_flip( $ua );
unset( $ua[ 'facebookexternalhit' ] );
$ua = array_flip( $ua );
}
return $ua;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment