{"id":1386,"date":"2021-07-26T06:10:46","date_gmt":"2021-07-26T11:10:46","guid":{"rendered":"https:\/\/www.knownhost.com\/kb\/?p=1386"},"modified":"2021-10-18T06:26:44","modified_gmt":"2021-10-18T11:26:44","slug":"how-to-manage-wordpress-posts-using-sql","status":"publish","type":"post","link":"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/","title":{"rendered":"How To Manage WordPress Posts Using SQL"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #212121;color:#212121\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #212121;color:#212121\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#how_to_find_wordpress_posts_with_the_most_spam_comments_using_sql\" >How to Find WordPress Posts with the Most Spam Comments using SQL?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#how_to_find_wordpress_posts_with_the_most_comments_using_sql\" >How to Find WordPress Posts with the Most Comments using SQL?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#how_to_turn_off_trackbacks_on_all_wordpress_posts_using_sql\" >How to Turn Off Trackbacks on All WordPress Posts using SQL?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#how_to_set_all_posts_to_accept_comments_only_from_registered_users_using_sql\" >How to Set All Posts to Accept Comments Only from Registered Users using SQL?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#how_to_remove_nofollow_link_markup_in_wordpress_posts_using_sql\" >How to Remove Nofollow Link Markup in WordPress Posts using SQL?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#how_to_remove_any_text_string_in_wordpress_posts_using_sql\" >How to Remove Any Text String in WordPress Posts using SQL?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#how_to_remove_post_revisions_from_wordpress_using_sql\" >How to Remove Post Revisions from WordPress using SQL?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#how_to_replace_any_text_string_in_wordpress_posts_using_sql\" >How to Replace Any Text String in WordPress Posts using SQL?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#how_to_clean_up_posts_by_removing_specific_shortcodes_in_wordpress_using_sql\" >How to Clean Up Posts by Removing Specific Shortcodes in WordPress using SQL?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#how_to_find_all_wordpress_posts_via_category_id\" >How to Find All WordPress Posts via Category ID?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#how_to_change_wordpress_post_author_and_change_ownership\" >How to Change WordPress Post Author and Change Ownership?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#how_to_delete_wordpress_comments_based_on_author_url_using_sql\" >How to Delete WordPress Comments Based on Author URL using SQL?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#what_are_the_default_post_statuses_in_wordpress\" >What are the Default Post Statuses in WordPress?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#what_post_comment_status_should_be_used_when_turning_comments_on_or_off\" >What Post Comment Status Should be Used When Turning Comments On or Off?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#how_to_remove_duplicate_comments_in_wordpress\" >How to Remove Duplicate Comments in WordPress?<\/a><\/li><\/ul><\/nav><\/div>\n\n<h3 class=\"wp-block-heading\" id=\"how_to_find_wordpress_posts_with_the_most_spam_comments_using_sql\"><span class=\"ez-toc-section\" id=\"how_to_find_wordpress_posts_with_the_most_spam_comments_using_sql\"><\/span>How to Find WordPress Posts with the Most Spam Comments using SQL?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The below query will help you identify the top 7 posts having the most comments that have been flagged as spam.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  SELECT comment_post_ID, COUNT(*) as spamcnt\n  FROM wp_comments WHERE comment_approved = 'spam'\n  GROUP BY comment_post_ID\n  ORDER BY spamcnt DESC LIMIT 0, 7<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how_to_find_wordpress_posts_with_the_most_comments_using_sql\"><span class=\"ez-toc-section\" id=\"how_to_find_wordpress_posts_with_the_most_comments_using_sql\"><\/span>How to Find WordPress Posts with the Most Comments using SQL?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The below query will help you identify the top 7 posts having the most comments.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  SELECT comment_post_ID, COUNT(*) as commentcnt\n  FROM wp_comments \n  GROUP BY comment_post_ID\n  ORDER BY commentcnt DESC LIMIT 0, 7<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how_to_turn_off_trackbacks_on_all_wordpress_posts_using_sql\"><span class=\"ez-toc-section\" id=\"how_to_turn_off_trackbacks_on_all_wordpress_posts_using_sql\"><\/span>How to Turn Off Trackbacks on All WordPress Posts using SQL?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In one fell swoop you can disable trackbacks on all posts by running this SQL statement:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  UPDATE wp_posts SET ping_status = 'closed';<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how_to_set_all_posts_to_accept_comments_only_from_registered_users_using_sql\"><span class=\"ez-toc-section\" id=\"how_to_set_all_posts_to_accept_comments_only_from_registered_users_using_sql\"><\/span>How to Set All Posts to Accept Comments Only from Registered Users using SQL?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The below SQL statement will force users to register in order to be able to comment. It could be extended with conditions, such as only implementing this on posts newer than a certain date or in a particular category only.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  UPDATE wp_posts SET comment_status = 'registered_only';<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how_to_remove_nofollow_link_markup_in_wordpress_posts_using_sql\"><span class=\"ez-toc-section\" id=\"how_to_remove_nofollow_link_markup_in_wordpress_posts_using_sql\"><\/span>How to Remove Nofollow Link Markup in WordPress Posts using SQL?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You can use a text replace SQL update statement to erase nofollow markup in post content easy enough. However, keep in mind that if you\u2019ve been writing about SEO or online marketing topics, you could easily be erasing words in your text that you\u2019d like to keep present!<\/p>\n\n\n\n<p>The below statement attempt to avoid this by looking for a lack of spacing before or after the text nofollow, such as one would expect in link markup:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  UPDATE wp_posts SET post_content = REPLACE ( post_content, 'nofollow ', '' );\n  UPDATE wp_posts SET post_content = REPLACE ( post_content, ' nofollow', '' );\n  UPDATE wp_posts SET post_content = REPLACE ( post_content, ' rel=\"nofollow\"', '' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how_to_remove_any_text_string_in_wordpress_posts_using_sql\"><span class=\"ez-toc-section\" id=\"how_to_remove_any_text_string_in_wordpress_posts_using_sql\"><\/span>How to Remove Any Text String in WordPress Posts using SQL?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Removing text can come in handy when you\u2019ve got spam, competitor mentions, bad words or unwanted text, etc. Sometimes it\u2019s good enough to just remove the text string in question.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  UPDATE wp_posts \n  SET post_content = REPLACE ( post_content, 'target text to be removed', '' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how_to_remove_post_revisions_from_wordpress_using_sql\"><span class=\"ez-toc-section\" id=\"how_to_remove_post_revisions_from_wordpress_using_sql\"><\/span>How to Remove Post Revisions from WordPress using SQL?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you compose in the <a href=\"https:\/\/www.knownhost.com\/kb\/how-to-edit-pages-in-wordpress\/\">WordPress editor<\/a>, and make a lot of changes as you go, WordPress will store revision history in the database, so you can easily roll-back to an earlier point in time. This is great if you foobar something or change your mind, but it comes at a price &#8211; database size.<\/p>\n\n\n\n<p>Post revisions do get cleaned up automatically, but typically only after 30 or so days. That means, if you\u2019re a fairly prolific author, there can be a load of revisions sitting in the database taking up space.<\/p>\n\n\n\n<p>Revisions can be quickly cleaned with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  DELETE FROM wp_posts \n  WHERE post_type = \"revision\";<\/code><\/pre>\n\n\n\n<p>The only problem with cleaning revisions alone is that there\u2019s a lot more to a revision than just an entry in wp_posts. In fact, wp_term_relationships and wp_postmeta have a lot of accompanying information that could get orphaned if we just deleted revisions from wp_posts.<\/p>\n\n\n\n<p>So, the preferred method would be to clean them all<\/p>\n\n\n\n<p>First the posts that are revisions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  DELETE FROM wp_posts \n  WHERE post_type = \"revision\";<\/code><\/pre>\n\n\n\n<p>Then the postmeta:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  DELETE FROM wp_postmeta \n  WHERE post_id NOT IN\n    (SELECT ID FROM wp_posts);<\/code><\/pre>\n\n\n\n<p>Finally term_relationships:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  DELETE FROM wp_term_relationships \n  WHERE object_id NOT IN\n    (SELECT ID FROM wp_posts);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how_to_replace_any_text_string_in_wordpress_posts_using_sql\"><span class=\"ez-toc-section\" id=\"how_to_replace_any_text_string_in_wordpress_posts_using_sql\"><\/span>How to Replace Any Text String in WordPress Posts using SQL?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>While it\u2019s great to blank out text, like an eraser, there are occasions where you might instead want to replace the text with something different. Maybe you\u2019ve got newer posts or updated information you\u2019d like to swap in. There are many situations that this ability to replace text can come in handy. The SQL isn\u2019t too bad either:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  UPDATE wp_posts \n  SET post_content = REPLACE ( post_content, 'target text to be replaced', 'the new text doing the replacing' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how_to_clean_up_posts_by_removing_specific_shortcodes_in_wordpress_using_sql\"><span class=\"ez-toc-section\" id=\"how_to_clean_up_posts_by_removing_specific_shortcodes_in_wordpress_using_sql\"><\/span>How to Clean Up Posts by Removing Specific Shortcodes in WordPress using SQL?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you\u2019ve switched themes or made other changes that mean you\u2019ve got some shortcodes floating about that you\u2019d like to remove, specific shortcodes can be eliminated with a SQL one-liner:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  UPDATE wp_post\n  SET post_content = REPLACE(post_content, '&#91;oldshortcode]', '' ) ;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how_to_find_all_wordpress_posts_via_category_id_using_sql\"><span class=\"ez-toc-section\" id=\"how_to_find_all_wordpress_posts_via_category_id\"><\/span>How to Find All WordPress Posts via Category ID?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The below SQL statement assumes your category ID is 123.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  SELECT * FROM wp_posts \n  JOIN wp_term_relationships \n  ON (wp_posts.ID = wp_term_relationships.object_id) \n  WHERE wp_term_relationships.term_taxonomy_id = 123;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how_to_change_wordpress_post_author_and_change_ownership_using_sql\"><span class=\"ez-toc-section\" id=\"how_to_change_wordpress_post_author_and_change_ownership\"><\/span>How to Change WordPress Post Author and Change Ownership?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>When you have a change of editorial staff, have an employee leave, or otherwise want to reassign ownership of posts from one author to another, it can be done via SQL:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  UPDATE wp_posts \n  SET post_author = 'id-of-new-authorowner' \n  WHERE post_author = 'id-of-old-authorowner';<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how_to_delete_wordpress_comments_based_on_author_url_using_sql\"><span class=\"ez-toc-section\" id=\"how_to_delete_wordpress_comments_based_on_author_url_using_sql\"><\/span>How to Delete WordPress Comments Based on Author URL using SQL?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Spam can be a nasty thing, particularly when it arrives in bulk. For situations like that, the ability to find, and remove, comments in chunks, rather than one at a time, can be a lifesaver.<\/p>\n\n\n\n<p>When you\u2019ve noticed one, or many, different comment authors using a particular&nbsp;URL&nbsp;or domain in their posts &#8211; an old, spammy, SEO technique, you can use the below SQL delete statement to remove them all at once. Be sure to replace the text inside the % % with the offending domain, or full&nbsp;URL. Sometimes it\u2019s best to do a select statement to find the size of returned results before actually running a delete statement.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  SELECT * \n  FROM wp_comments \n  WHERE comment_author \n  LIKE \u2018%offendingurlordomain%\u2019;<\/code><\/pre>\n\n\n\n<p>Then<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  DELETE FROM wp_comments \n  WHERE comment_author like \u2018%offendingurlordomain%\u2019;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what_are_the_default_post_statuses_in_wordpress\"><span class=\"ez-toc-section\" id=\"what_are_the_default_post_statuses_in_wordpress\"><\/span>What are the Default Post Statuses in WordPress?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In wp_posts, post_status can be set to any of these:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Publish<\/li><li>Future<\/li><li>Draft<\/li><li>Pending<\/li><li>Private<\/li><li>Trash<\/li><li>Auto-Draft<\/li><li>Inherit<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what_post_comment_status_should_be_used_when_turning_comments_on_or_off\"><span class=\"ez-toc-section\" id=\"what_post_comment_status_should_be_used_when_turning_comments_on_or_off\"><\/span>What Post Comment Status Should be Used When Turning Comments On or Off?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In wp_posts, comment_status should be \u201copen\u201d when comments are allowed or \u201cclosed\u201d when they aren\u2019t.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how_to_remove_duplicate_comments_in_wordpress\"><span class=\"ez-toc-section\" id=\"how_to_remove_duplicate_comments_in_wordpress\"><\/span>How to Remove Duplicate Comments in WordPress?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Ever click something, wait, think nothing happened, and you click it again?<\/p>\n\n\n\n<p>Theoretically WordPress should have duplicate comments, unless someone submits the same thing multiple times. While that may sound a bit far fetched, the case of short comments becomes the litmus test. One word comments like, \u201cThanks\u201d will get removed, leaving just one Thanks comment behind. Two word, three word &#8211; you can see how duplicate comment content can easily happen &#8211; because there\u2019s just not enough comment content to make it unique.<\/p>\n\n\n\n<p>However, if you\u2019re wanting to clean up duplicate comments, this SQL statement can do it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  DELETE FROM wp_comments\n  USING wp_comments, wp_comments AS commcompar\n    WHERE (NOT wp_comments.ID=commcompar.ID)\n    AND (wp_comments.comment_content=commcompar.comment_content);<\/code><\/pre>\n\n\n\n<p>If you want to learn about SQL you can read on <a href=\"https:\/\/www.mysql.com\/\">MySQL documentation page<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Find WordPress Posts with the Most Spam Comments using SQL? The below query will help you identify the top 7 posts having the most comments that have been flagged as spam. How to Find WordPress Posts with the Most Comments using SQL? The below query will help you identify the top 7 posts [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[146],"tags":[251,252,257,255,106],"class_list":["post-1386","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-blogs","tag-cms","tag-database","tag-sql","tag-wordpress"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Manage WordPress Posts Using SQL - KnownHost<\/title>\n<meta name=\"description\" content=\"Are you looking for a way to manage WordPress posts? In this article we will show you how to manage WP post using SQL database.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Manage WordPress Posts Using SQL - KnownHost\" \/>\n<meta property=\"og:description\" content=\"Are you looking for a way to manage WordPress posts? In this article we will show you how to manage WP post using SQL database.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/\" \/>\n<meta property=\"og:site_name\" content=\"KnownHost\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-26T11:10:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-18T11:26:44+00:00\" \/>\n<meta name=\"author\" content=\"Jonathan K. W.\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jonathan K. W.\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-manage-wordpress-posts-using-sql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-manage-wordpress-posts-using-sql\\\/\"},\"author\":{\"name\":\"Jonathan K. W.\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/3db6e20d1f33519cd68fe0ba1230a48b\"},\"headline\":\"How To Manage WordPress Posts Using SQL\",\"datePublished\":\"2021-07-26T11:10:46+00:00\",\"dateModified\":\"2021-10-18T11:26:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-manage-wordpress-posts-using-sql\\\/\"},\"wordCount\":940,\"keywords\":[\"blogs\",\"cms\",\"database\",\"SQL\",\"wordpress\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-manage-wordpress-posts-using-sql\\\/\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-manage-wordpress-posts-using-sql\\\/\",\"name\":\"How To Manage WordPress Posts Using SQL - KnownHost\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#website\"},\"datePublished\":\"2021-07-26T11:10:46+00:00\",\"dateModified\":\"2021-10-18T11:26:44+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/3db6e20d1f33519cd68fe0ba1230a48b\"},\"description\":\"Are you looking for a way to manage WordPress posts? In this article we will show you how to manage WP post using SQL database.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-manage-wordpress-posts-using-sql\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-manage-wordpress-posts-using-sql\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-manage-wordpress-posts-using-sql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Manage WordPress Posts Using SQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/\",\"name\":\"KnownHost\",\"description\":\"KnownHost provides a comprehensive webhosting knowledge base to help answer many of your common webhosting and linux questions.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/3db6e20d1f33519cd68fe0ba1230a48b\",\"name\":\"Jonathan K. W.\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g\",\"caption\":\"Jonathan K. W.\"},\"sameAs\":[\"https:\\\/\\\/www.knownhost.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Manage WordPress Posts Using SQL - KnownHost","description":"Are you looking for a way to manage WordPress posts? In this article we will show you how to manage WP post using SQL database.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/","og_locale":"en_US","og_type":"article","og_title":"How To Manage WordPress Posts Using SQL - KnownHost","og_description":"Are you looking for a way to manage WordPress posts? In this article we will show you how to manage WP post using SQL database.","og_url":"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/","og_site_name":"KnownHost","article_published_time":"2021-07-26T11:10:46+00:00","article_modified_time":"2021-10-18T11:26:44+00:00","author":"Jonathan K. W.","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jonathan K. W.","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#article","isPartOf":{"@id":"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/"},"author":{"name":"Jonathan K. W.","@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/3db6e20d1f33519cd68fe0ba1230a48b"},"headline":"How To Manage WordPress Posts Using SQL","datePublished":"2021-07-26T11:10:46+00:00","dateModified":"2021-10-18T11:26:44+00:00","mainEntityOfPage":{"@id":"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/"},"wordCount":940,"keywords":["blogs","cms","database","SQL","wordpress"],"articleSection":["WordPress"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/","url":"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/","name":"How To Manage WordPress Posts Using SQL - KnownHost","isPartOf":{"@id":"https:\/\/www.knownhost.com\/kb\/#website"},"datePublished":"2021-07-26T11:10:46+00:00","dateModified":"2021-10-18T11:26:44+00:00","author":{"@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/3db6e20d1f33519cd68fe0ba1230a48b"},"description":"Are you looking for a way to manage WordPress posts? In this article we will show you how to manage WP post using SQL database.","breadcrumb":{"@id":"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.knownhost.com\/kb\/how-to-manage-wordpress-posts-using-sql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.knownhost.com\/kb\/"},{"@type":"ListItem","position":2,"name":"How To Manage WordPress Posts Using SQL"}]},{"@type":"WebSite","@id":"https:\/\/www.knownhost.com\/kb\/#website","url":"https:\/\/www.knownhost.com\/kb\/","name":"KnownHost","description":"KnownHost provides a comprehensive webhosting knowledge base to help answer many of your common webhosting and linux questions.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.knownhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/3db6e20d1f33519cd68fe0ba1230a48b","name":"Jonathan K. W.","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g","caption":"Jonathan K. W."},"sameAs":["https:\/\/www.knownhost.com"]}]}},"_links":{"self":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts\/1386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/comments?post=1386"}],"version-history":[{"count":0,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts\/1386\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/media?parent=1386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/categories?post=1386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/tags?post=1386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}