-
-
Save AltanS/30c0d636c98c5ec69e7367f3a592d63d to your computer and use it in GitHub Desktop.
YoastSEO WordPress - accessing values in PHP code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
YoastSEO()->meta->for_post($post->ID)->title; | |
YoastSEO()->meta->for_post($post->ID)->canonical; | |
// Other values with their default values | |
// 'canonical' => null, | |
// 'title' => null, | |
// 'description' => null, | |
// 'open_graph_title' => null, | |
// 'open_graph_image' => 'open_graph_image', | |
// 'open_graph_image_id' => 'open_graph_image_id', | |
// 'open_graph_description' => null, | |
// 'twitter_title' => null, | |
// 'twitter_image' => 'twitter_image', | |
// 'twitter_image_id' => null, | |
// 'twitter_description' => null, | |
// 'is_cornerstone' => '1', | |
// 'is_robots_noindex' => null, | |
// 'is_robots_nofollow' => '0', | |
// 'is_robots_noarchive' => null, | |
// 'is_robots_noimageindex' => null, | |
// 'is_robots_nosnippet' => null, | |
// 'primary_focus_keyword' => null, | |
// 'primary_focus_keyword_score' => null, | |
// 'readability_score' => '50', | |
// 'inclusive_language_score' => '42', | |
// 'schema_page_type' => 'FAQPage', | |
// 'schema_article_type' => 'NewsArticle', | |
// 'estimated_reading_time_minutes' => '11', |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment