Remove meta description on wordpress



" "

function.php Theme



:
function remove_meta_descriptions($html) {
    $pattern = '/<meta name(.*)=(.*)"description"(.*)>/i';
    $html = preg_replace($pattern, '', $html);
    return $html;
}
function clean_meta_descriptions($html) {
    ob_start('remove_meta_descriptions');
}
add_action('get_header', 'clean_meta_descriptions', 100);
add_action('wp_footer', function(){ ob_end_flush(); }, 100);


function.php template-child


:
<?php
/**
 * your theme here functions and definitions.
 *
 * @link https://developer.wordpress.org/themes/basics/theme-functions/
 *
 * @package your theme here
 */

  function remove_meta_descriptions($html) {
    $pattern = '/<meta name(.*)=(.*)"description"(.*)>/i';
    $html = preg_replace($pattern, '', $html);
    return $html;
}
function clean_meta_descriptions($html) {
    ob_start('remove_meta_descriptions');
}
add_action('get_header', 'clean_meta_descriptions', 100);
add_action('wp_footer', function(){ ob_end_flush(); }, 100);