0

I'm cleaning up some HTML code, and I would like to have a HTML structure that looks like this:

<!DOCTYPE html>
<html >
<head>
<title>...</title>
<meta name="description" content="..." />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> ...

So basically I want 'title' and 'meta description' to appear right after 'head' tag. Site is running Wordpress , so I already looked into general-template.php -file but didn’t find output for ‘meta description’.

Do I need to install a plugin for meta description (Yoast for example) and then change the location of the wp_head() ? Or do I need to edit the wp_head() function somehow?

koppa
  • 39
  • 1
  • 1
  • 7
  • might be SEO believer thinks that search engine bots cant read if content is not in particular order. Are you wasting time on this? check header.php in theme folder. – Ali Exalter Sep 19 '13 at 15:25

3 Answers3

0

edit you themes header.php, simple :) make sure <?php wp_head();?> is beneath all of that if it exists...

danyo
  • 5,686
  • 20
  • 59
  • 119
0

Just make sure <?php wp_head();?> is between your head tags. That way when you install Yoast SEO or any plugin, the proper content will be inserted there.

bradcush
  • 528
  • 3
  • 8
0

There are a lot cleaning head solutons like addding hooks to clean most of the worpress default functionality(RSD, RSS links etc.). Try out following hooks in theme functions.php:

/*remove actions to clean wp_head*/
remove_action('wp_head', 'wlwmanifest_link'); // remove wlwmanifest.xml (needed to support windows live writer)
remove_action('wp_head', 'wp_generator'); // remove wordpress version
remove_action( 'wp_head', 'wp_resource_hints', 2 );//remove dns prefech
remove_action('wp_head', 'rsd_link'); // remove really simple discovery link
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0 ); // remove shortlink

remove_action( 'wp_head', 'print_emoji_detection_script', 7 );  // remove emojis
remove_action( 'wp_print_styles', 'print_emoji_styles' );   // remove emojis

remove_action('wp_head', 'adjacent_posts_rel_link_wp_head'); // remove the / and previous post links

remove_action('wp_head', 'feed_links', 2); // remove rss feed links
remove_action('wp_head', 'feed_links_extra', 3); // removes all extra rss feed links

remove_action( 'wp_head', 'rest_output_link_wp_head', 10 ); // remove the REST API link
remove_action( 'wp_head', 'wp_oembed_add_discovery_links' ); // remove oEmbed discovery links
remove_action( 'template_redirect', 'rest_output_link_header', 11, 0 ); // remove the REST API link from HTTP Headers

remove_action( 'wp_head', 'wp_oembed_add_host_js' ); // remove oEmbed-specific javascript from front-end / back-end

remove_action('rest_api_init', 'wp_oembed_register_route'); // remove the oEmbed REST API route
remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10); // don't filter oEmbed results

You may also wrap this snippet into functions to make it work after_theme_setup or init

Other tags like charset and http-equiv attributes can be insluded after wp_head(); action in header.php. Also take a look at the wp-includes template folder files to locate wp_head() action and remove/comment unnecessary actions