'Simple question regarding PHP, Wordpress & Yoast SEO

I have WordPress. I struggle with the code order in the HEAD section. The meta title, description, etc (Yoast plugin) comes at the very end of the head section, after the theme's header-codes, and 4 other plugins that have a header code. I believe this is bad because Google doesn't seem to use my very good meta title & description. I observe that all other websites have their meta title and description at the very first in their source code.

I tried fixing this by placing <?php wp_head (); ?> at the top of the theme's head section instead of bottom(default). This kind of worked by putting the plugin's head-code before the theme's head-code, BUT other plugins still comes before the YOAST. I deleted one of them in frustration...

But, I assume there exists one simple snipped that "gets" the Yoast code exclusively, not all other plugins as well, that I could just copy-paste at the top of the header section in the theme editor? And then but the PHP wp_head at last again.

So that my header section in the source code will have this order:

  1. Yoast SEO meta title, description ++.
  2. Main header code (fonts, verifications, color bar).
  3. All the other header plugins that I don't get why are in the header.

I hope this wasn't too confusing, English isn't my language. I've tried googling for such a snippet or issue, but haven't found something. I don't know PHP at all.

My question is: is there a PHP snippet that I can copy-paste at the top in my theme header section, a snippet that "gets" the Yoast meta tags?. Similar to the code I have written above, just that it gets only yoast, and not the other plugins! I want the meta tags to be at the very top of my source code for the header section, not at the bottom.



Solution 1:[1]

Problems with the way the search engine displays your search results are not the result of the ordering of objects in your page's HEAD tag. (You can trust Yoast to get this stuff right.) Google does whatever they want with your metadata, including nothing. They write their own titles and search-result snippets for many many pages.

And they don't disclose what they do or how they do it. Otherwise they'd get gamed even more than they are by "SEO Optimizers."

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 O. Jones