BioSyntheticDesigns
11/20/2012 - 6:45 PM

Remove unnecessary markup from WooCommerce

Remove unnecessary markup from WooCommerce

<?php

/**
 * Remove unnecessary markup from WooCommerce:
 *
 * 1. Remove <meta name="generator" content="WooCommerce (version)" />
 * 2. Remove the addition of <body class="theme-themename">
 */
function woocommerce_head_cleanup() {
  global $woocommerce;
  remove_action('wp_head', array($woocommerce, 'generator'));
}
add_action('woocommerce_init', 'woocommerce_head_cleanup');

function woocommerce_remove_theme_body_class($classes) {
  $theme_name = wp_get_theme();
  $theme_name = 'theme-' . sanitize_html_class(strtolower($theme_name));

  $remove_classes = array($theme_name);
  $classes = array_diff($classes, $remove_classes);

  return $classes;
}
add_filter('body_class', 'woocommerce_remove_theme_body_class', 100);