InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Wordpress Mysql Query tutorials

  • How to delete orphan wordpress wp_postmeta rows
  • Mysql query to find all yoast meta description
  • Query to find recently modified posts in Wordpress
  • Wordpress - an approach to bulk add tags to posts
  • Wordpress - query to dump all categories
  • Wordpress - query to dump all posts with featured image
  • Wordpress - query to dump all tags
  • Wordpress - query to find all posts for a category
  • Wordpress - query to find term_taxonomy_id from category name
  • Wordpress - query to find term_taxonomy_id from tag name
  • Wordpress mysql query to get all custom keys and values for a post
  • Wordpress mysql query to get all posts with a missing custom field
  • Wordpress mysql query to get all posts with a specific custom field
  • migrate multiple mysql databases using mysqldump on Linux
 
  • Home
  • > Tutorials
  • > Wordpress
  • > Wordpress Mysql Queries

Mysql query to find all yoast meta description

By admin on Dec 1, 2015

In case you are are using Yoast plugin for SEO and using it to enter meta post description, you can query meta descriptions of all posts stored in custom field _yoast_wpseo_metadesc. This may be handy to bulk review the meta descriptions of all your posts and pages. Here are some queries to get custom field _yoast_wpseo_metadesc for all posts:

_yoast_wpseo_metadesc meta values for all posts

This query will display null in case _yoast_wpseo_metadesc meta_value does not exist.

SELECT p.ID, p.post_title, pm.meta_key, pm.meta_value
FROM wp_posts p
LEFT JOIN wp_postmeta pm ON p.ID = pm.post_id AND pm.meta_key = '_yoast_wpseo_metadesc'
WHERE p.post_type in ('post', 'page')
AND p.post_status='publish'

Posts with null _yoast_wpseo_metadesc meta value

This query will display all post where _yoast_wpseo_metadesc meta value does not exist.

SELECT p.ID, p.post_title, pm.meta_key, pm.meta_value
FROM wp_posts p
LEFT JOIN wp_postmeta pm ON p.ID = pm.post_id AND pm.meta_key = '_yoast_wpseo_metadesc'
WHERE p.post_type in ('post', 'page')
AND p.post_status='publish'
AND pm.meta_key IS NULL

Note these queries can be used to find meta value for other meta keys after slight modification.

Suggested posts:

  1. Chrome – view javascript errors
  2. PHP check if key exists in array
  3. HTML li tag
  4. Curl – follow redirects
  5. How to search files by name in Mac Finder
  6. How to create Linux instance on Amazon AWS/EC2 Classic
  7. How to display wordpress top level pages
  8. WordPress – query to find all posts for a category
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged SEO, Tutorials, Wordpress, Wordpress Mysql Queries
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress