SHARE
TWEET

find and replace meta and link tage

a guest Jun 20th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function remove_meta_descriptions($html) {
  2.     $pattern = '@<link rel="icon" href="https://restorationspros.com/wp-content/uploads/2019/05/cropped-Water-Fire-Damage-Restoration-_-Mold-Remediation-_-Restoration-Pros-Near-You-0-1-32x32.png" sizes="32x32" />@i';
  3.     $html = preg_replace($pattern, '', $html);
  4.  
  5.     $pattern = '@<link rel="icon" href="https://restorationspros.com/wp-content/uploads/2019/05/cropped-Water-Fire-Damage-Restoration-_-Mold-Remediation-_-Restoration-Pros-Near-You-0-1-192x192.png" sizes="192x192" />@i';
  6.     $html = preg_replace($pattern, '', $html);
  7.  
  8.     $pattern = '@<link rel="apple-touch-icon-precomposed" href="https://restorationspros.com/wp-content/uploads/2019/05/cropped-Water-Fire-Damage-Restoration-_-Mold-Remediation-_-Restoration-Pros-Near-You-0-1-180x180.png" />@i';
  9.     $html = preg_replace($pattern, '', $html);
  10.    
  11.     $pattern = '@<meta name="msapplication-TileImage" content="https://restorationspros.com/wp-content/uploads/2019/05/cropped-Water-Fire-Damage-Restoration-_-Mold-Remediation-_-Restoration-Pros-Near-You-0-1-270x270.png" />@i';
  12.     $html = preg_replace($pattern, '', $html);
  13.     return $html;
  14. }
  15. function clean_meta_descriptions($html) {
  16.     ob_start('remove_meta_descriptions');
  17. }
  18. add_action('get_header', 'clean_meta_descriptions', 100);
  19. add_action('wp_footer', function(){ ob_end_flush(); }, 100);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top