{"id":4424,"date":"2018-03-05T15:50:47","date_gmt":"2018-03-05T15:50:47","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2018\/03\/05\/how-to-view-page-content-using-wp-cli\/"},"modified":"2021-08-16T22:28:23","modified_gmt":"2021-08-17T02:28:23","slug":"how-to-view-page-content-using-wp-cli","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/","title":{"rendered":"How to View Page Content Using WP-CLI"},"content":{"rendered":"<p>InMotion Hosting&#8217;s <a title=\"Click here to navigate to our main website and review our available WordPress Hosting plans.\" href=\"https:\/\/www.inmotionhosting.com\/wordpress-hosting\" target=\"_blank\" rel=\"noopener\">WordPress Hosting<\/a> includes <abbr title=\"WordPress Command Line Interface\">WP-CLI<\/abbr>. This intuitive tool allows you to maintain your WordPress websites&#8217; content directly from the command line, as an alternative to using the Administrative Dashboard. In this guide, you will learn how to <strong>display the content of a Page<\/strong>, from the Command Line, using the <em>wp post get<\/em> command, in <strong>WP-CLI<\/strong>.<\/p>\n<p><a name=\"view-page-content\"><\/a><\/p>\n<h2>View Page Content<\/h2>\n<p>First you will need to <a title=\"Click here to navigate to our guide and learn how to find the ID of a WordPress Page using WP-CLI.\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-find-post-details-using-wp-cli\/#list-page-details\" target=\"_blank\" rel=\"noopener\">find the ID of the Page<\/a>. You can use the <i>ID<\/i> to identify and manipulate each Page in <strong>WP-CLI<\/strong>. Once you find the Page ID, you can use the <em>wp post get<\/em> subcommand to find the content of a particular Page. To <strong>view the content of a page<\/strong>, simply follow the steps below.<\/p>\n<ol class=\"article_list\">\n<li>\n<p><a title=\"Click here to navigate to our guide and learn how to use SSH to connect to your server.\" href=\"\/support\/server\/ssh\/shared-reseller-ssh\/\" target=\"_blank\" rel=\"noopener\">SSH into your server<\/a> as the cPanel user that owns the website you would like to work with.<\/p>\n<\/li>\n<li>\n<p>Use the <span class=\"cli\">cd<\/span> command to switch to the <a title=\"Click here to navigate to our guide and learn how to find the document root directory of your website.\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/where-to-upload-files\/\" target=\"_blank\" rel=\"noopener\">document root directory of your website<\/a>.<\/p>\n<p>Example: <span class=\"cli\">cd <b>public_html\/wp<\/b><\/span><\/p>\n<div class=\"alert alert-info\" role=\"alert\"><b>NOTE: <\/b>Be sure to replace <span class=\"cli\"><b>public_html\/wp<\/b><\/span> with the actual path to the document root directory of your website.<\/div>\n<\/li>\n<li>\n<p>Run the following command:<\/p>\n<p><span class=\"cli\">wp post get <b>##<\/b> &#8211;field=post_content<\/span><\/p>\n<div class=\"alert alert-info\" role=\"alert\"><b>NOTE: <\/b>Be sure to replace <span class=\"cli\"><b>##<\/b><\/span> with the <i>actual ID of the Page<\/i> you are working with.<\/div>\n<\/li>\n<\/ol>\n<p>The output will be similar to the example below:<\/p>\n<pre class=\"cli\">exampl3@example.com [~\/public_html\/wp]# wp post get 42 --field=post_content &lt;div class=\"boldgrid-section\"&gt; &lt;div class=\"container\"&gt; &lt;div class=\"row gridblock\"&gt; &lt;div class=\"col-md-6 col-xs-12 col-sm-12\"&gt; &lt;h2 class=\"\"&gt;The Write Stuff&lt;\/h2&gt; &lt;h4 class=\"\"&gt;A Better Copywriting Service&lt;\/h4&gt; &lt;div class=\"row gridblock\"&gt; &lt;div class=\"col-md-12 col-xs-12 col-sm-12\"&gt;  &lt;hr&gt;&lt;\/div&gt; &lt;\/div&gt; &lt;\/div&gt; &lt;div class=\"col-md-6 col-sm-12 col-xs-12\"&gt;  &nbsp;  &lt;\/div&gt; &lt;\/div&gt; &lt;\/div&gt; &lt;\/div&gt; &lt;div class=\"boldgrid-section\"&gt; &lt;div class=\"container\"&gt; &lt;div class=\"row gridblock\"&gt; &lt;div class=\"col-md-6 col-margin-bottom col-xs-12 col-sm-12\"&gt;  The concept for my company was a team effort. After chatting with local copywriters at a marketing expo, founder Janet Riley wanted to create a business where marketers and copywriters could work together to create a message that clients could genuinely get behind while driving sales for that client. Tired of the continuous process of finding clients, wooing them into hiring her for projects and then having to start over again once the project was complete, she dreamed of a better way.<\/pre>\n<p>Now that you are familiar with a <em>Page ID<\/em>, you can use that ID to <strong>view the Page content<\/strong>.<\/p>\n\n<p>Learn more about <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/\">WP-CLI<\/a>, the command-line interface for WordPress, and how to streamline your WordPress maintenance workflows!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>InMotion Hosting&#8217;s WordPress Hosting includes WP-CLI. This intuitive tool allows you to maintain your WordPress websites&#8217; content directly from the command line, as an alternative to using the Administrative Dashboard. In this guide, you will learn how to display the content of a Page, from the Command Line, using the wp post get command, in<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/\"> Read More ><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4374],"tags":[],"class_list":["post-4424","post","type-post","status-publish","format-standard","hentry","category-wp-cli"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to View Page Content Using WP-CLI | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"In this guide, you will learn how to list the content of a WordPress Page, from the Command Line, using the wp post command, in WP-CLI.\" \/>\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.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to View Page Content Using WP-CLI | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"In this guide, you will learn how to list the content of a WordPress Page, from the Command Line, using the wp post command, in WP-CLI.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-05T15:50:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-17T02:28:23+00:00\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5fbfcaed32a2672fb83ab312f5b7237b\"},\"headline\":\"How to View Page Content Using WP-CLI\",\"datePublished\":\"2018-03-05T15:50:47+00:00\",\"dateModified\":\"2021-08-17T02:28:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/\"},\"wordCount\":239,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"WP-CLI\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/\",\"name\":\"How to View Page Content Using WP-CLI | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2018-03-05T15:50:47+00:00\",\"dateModified\":\"2021-08-17T02:28:23+00:00\",\"description\":\"In this guide, you will learn how to list the content of a WordPress Page, from the Command Line, using the wp post command, in WP-CLI.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to View Page Content Using WP-CLI\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5fbfcaed32a2672fb83ab312f5b7237b\",\"name\":\"InMotion Hosting Contributor\",\"description\":\"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/inmotion-hosting\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/john-paul\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to View Page Content Using WP-CLI | InMotion Hosting","description":"In this guide, you will learn how to list the content of a WordPress Page, from the Command Line, using the wp post command, in WP-CLI.","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.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/","og_locale":"en_US","og_type":"article","og_title":"How to View Page Content Using WP-CLI | InMotion Hosting","og_description":"In this guide, you will learn how to list the content of a WordPress Page, from the Command Line, using the wp post command, in WP-CLI.","og_url":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2018-03-05T15:50:47+00:00","article_modified_time":"2021-08-17T02:28:23+00:00","author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5fbfcaed32a2672fb83ab312f5b7237b"},"headline":"How to View Page Content Using WP-CLI","datePublished":"2018-03-05T15:50:47+00:00","dateModified":"2021-08-17T02:28:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/"},"wordCount":239,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["WP-CLI"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/","url":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/","name":"How to View Page Content Using WP-CLI | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2018-03-05T15:50:47+00:00","dateModified":"2021-08-17T02:28:23+00:00","description":"In this guide, you will learn how to list the content of a WordPress Page, from the Command Line, using the wp post command, in WP-CLI.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/how-to-view-page-content-using-wp-cli\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to View Page Content Using WP-CLI"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5fbfcaed32a2672fb83ab312f5b7237b","name":"InMotion Hosting Contributor","description":"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!","sameAs":["https:\/\/www.linkedin.com\/company\/inmotion-hosting\/","https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/john-paul\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":4374,"name":"WP-CLI","slug":"wp-cli","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/4424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=4424"}],"version-history":[{"count":4,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/4424\/revisions"}],"predecessor-version":[{"id":83749,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/4424\/revisions\/83749"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=4424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=4424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=4424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}