{"id":1089,"date":"2015-12-07T18:47:16","date_gmt":"2015-12-07T18:47:16","guid":{"rendered":"https:\/\/www.codexworld.com\/?p=1089"},"modified":"2015-12-07T18:50:40","modified_gmt":"2015-12-07T18:50:40","slug":"wordpress-how-to-display-most-popular-posts-by-views","status":"publish","type":"post","link":"https:\/\/www.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/","title":{"rendered":"WordPress &#8211; How to Display Most Popular Posts by Views"},"content":{"rendered":"<p>Displays the most viewed posts at the sidebar are very helpful for visitors to find out the most popular post of your site. This tutorial will show you the simple way to display the most popular posts by views without using any plugin. You can get the most popular posts using simple WordPress most viewed posts query.<\/p>\n<div class=\"img_center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld.png\" alt=\"wordpress-how-to-display-most-popular-posts-by-views-by-codexworld\" width=\"601\" height=\"449\" class=\"alignnone size-full wp-image-1091\" srcset=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld.png 601w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld-300x224.png 300w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld-350x261.png 350w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld-320x239.png 320w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld-380x284.png 380w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld-200x149.png 200w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld-308x230.png 308w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><\/div>\n<p>We&#8217;ll use the post Meta for storing the post views count. Using the stored Meta value, we&#8217;ll fetch the posts according to the views count. You need to modify only two files <code>functions.php<\/code> and <code>single.php<\/code>. After that, you can display the most popular posts using simple posts query.<\/p>\n<h2>functions.php File<\/h2>\n<p>Open the <code>functions.php<\/code> file of the activated theme and add the following code. <\/p>\n<p><code>setPostViews()<\/code> function add or update the post meta with <code>post_views_count<\/code> meta key.<\/p>\n<pre><span style=\"color: #FF8000\">\/*<br \/>&nbsp;*&nbsp;Set&nbsp;post&nbsp;views&nbsp;count&nbsp;using&nbsp;post&nbsp;meta<br \/>&nbsp;*\/<br \/><\/span><span style=\"color: #007700\">function&nbsp;<\/span><span style=\"color: #0000BB\">setPostViews<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$postID<\/span><span style=\"color: #007700\">)&nbsp;{<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$countKey&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'post_views_count'<\/span><span style=\"color: #007700\">;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$count&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">get_post_meta<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$postID<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$countKey<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">true<\/span><span style=\"color: #007700\">);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;if(<\/span><span style=\"color: #0000BB\">$count<\/span><span style=\"color: #007700\">==<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$count&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">delete_post_meta<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$postID<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$countKey<\/span><span style=\"color: #007700\">);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">add_post_meta<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$postID<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$countKey<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'0'<\/span><span style=\"color: #007700\">);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;}else{<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$count<\/span><span style=\"color: #007700\">++;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">update_post_meta<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$postID<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$countKey<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$count<\/span><span style=\"color: #007700\">);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br \/>}<\/span><\/pre>\n<h2>single.php File<\/h2>\n<p>Open the <code>single.php<\/code> file from activated theme directory and place the <code>setPostViews()<\/code> function inside the loop.<\/p>\n<pre><span style=\"color: #0000BB\">setPostViews<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">get_the_ID<\/span><span style=\"color: #007700\">());<\/span><\/pre>\n<h2>Display the Most Viewed Posts<\/h2>\n<p>The following query will fetch the posts based on the <code>post_views_count<\/code> meta key value. Place the following code in the sidebar or where you want to display the most popular posts list.<\/p>\n<pre><span style=\"color: #0000BB\">&lt;?php<br \/><\/span><span style=\"color: #0000BB\">query_posts<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'meta_key=post_views_count&amp;orderby=meta_value_num&amp;order=DESC'<\/span><span style=\"color: #007700\">);<br \/>if&nbsp;(<\/span><span style=\"color: #0000BB\">have_posts<\/span><span style=\"color: #007700\">())&nbsp;:&nbsp;while&nbsp;(<\/span><span style=\"color: #0000BB\">have_posts<\/span><span style=\"color: #007700\">())&nbsp;:&nbsp;<\/span><span style=\"color: #0000BB\">the_post<\/span><span style=\"color: #007700\">();<br \/><\/span><span style=\"color: #0000BB\">?&gt;<br \/><\/span>    &lt;<span style=\"color:#bf4f24\">li<\/span>>&lt;<span style=\"color:#bf4f24\">a<\/span> <span style=\"color:#bf4f24\">href<\/span>=<span style=\"color:#0b6125\">\"<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;the_permalink<\/span><span style=\"color: #007700\">();&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"&gt;<span style=\"color: #0000BB\">&lt;?php&nbsp;the_title<\/span><span style=\"color: #007700\">();&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>&lt;\/<span style=\"color:#bf4f24\">a<\/span>>&lt;\/<span style=\"color:#bf4f24\">li<\/span>><br \/><span style=\"color: #0000BB\">&lt;?php<br \/><\/span><span style=\"color: #007700\">endwhile;&nbsp;endif;<br \/><\/span><span style=\"color: #0000BB\">wp_reset_query<\/span><span style=\"color: #007700\">();<\/span><br \/><span style=\"color: #0000BB\">?&gt;<\/span><\/pre>\n<div class=\"img_center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/most-popular-posts-list-by-codexworld.png\" alt=\"most-popular-posts-list-by-codexworld\" width=\"601\" height=\"449\" class=\"alignnone size-full wp-image-1090\" srcset=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/most-popular-posts-list-by-codexworld.png 601w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/most-popular-posts-list-by-codexworld-300x224.png 300w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/most-popular-posts-list-by-codexworld-200x149.png 200w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/most-popular-posts-list-by-codexworld-308x230.png 308w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Displays the most viewed posts at the sidebar are very helpful for visitors to find out the most popular post of your site. This tutorial will show you the simple way to display the most <\/p>\n","protected":false},"author":1,"featured_media":1091,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5],"tags":[101,25],"class_list":["post-1089","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-posts","tag-wordpress","cat-5-id","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>WordPress - How to Display Most Popular Posts by Views - CodexWorld<\/title>\n<meta name=\"description\" content=\"WordPress Most Popular Posts without Plugin \u2013 Learn how to display most popular posts by views in WordPress. WordPress most viewed posts query to get most popular posts.\" \/>\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.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WordPress - How to Display Most Popular Posts by Views - CodexWorld\" \/>\n<meta property=\"og:description\" content=\"WordPress Most Popular Posts without Plugin \u2013 Learn how to display most popular posts by views in WordPress. WordPress most viewed posts query to get most popular posts.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/\" \/>\n<meta property=\"og:site_name\" content=\"CodexWorld\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-07T18:47:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-12-07T18:50:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld.png\" \/>\n\t<meta property=\"og:image:width\" content=\"601\" \/>\n\t<meta property=\"og:image:height\" content=\"449\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CodexWorld\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codexworldblog\" \/>\n<meta name=\"twitter:site\" content=\"@codexworldweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CodexWorld\" \/>\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.codexworld.com\\\/wordpress-how-to-display-most-popular-posts-by-views\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/wordpress-how-to-display-most-popular-posts-by-views\\\/\"},\"author\":{\"name\":\"CodexWorld\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\"},\"headline\":\"WordPress &#8211; How to Display Most Popular Posts by Views\",\"datePublished\":\"2015-12-07T18:47:16+00:00\",\"dateModified\":\"2015-12-07T18:50:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/wordpress-how-to-display-most-popular-posts-by-views\\\/\"},\"wordCount\":193,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/wordpress-how-to-display-most-popular-posts-by-views\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/12\\\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld.png\",\"keywords\":[\"Posts\",\"WordPress\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/wordpress-how-to-display-most-popular-posts-by-views\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/wordpress-how-to-display-most-popular-posts-by-views\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wordpress-how-to-display-most-popular-posts-by-views\\\/\",\"name\":\"WordPress - How to Display Most Popular Posts by Views - CodexWorld\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/wordpress-how-to-display-most-popular-posts-by-views\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/wordpress-how-to-display-most-popular-posts-by-views\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/12\\\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld.png\",\"datePublished\":\"2015-12-07T18:47:16+00:00\",\"dateModified\":\"2015-12-07T18:50:40+00:00\",\"description\":\"WordPress Most Popular Posts without Plugin \u2013 Learn how to display most popular posts by views in WordPress. WordPress most viewed posts query to get most popular posts.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/wordpress-how-to-display-most-popular-posts-by-views\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/wordpress-how-to-display-most-popular-posts-by-views\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/wordpress-how-to-display-most-popular-posts-by-views\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/12\\\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/12\\\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld.png\",\"width\":601,\"height\":449,\"caption\":\"wordpress-how-to-display-most-popular-posts-by-views-by-codexworld\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/wordpress-how-to-display-most-popular-posts-by-views\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codexworld.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WordPress &#8211; How to Display Most Popular Posts by Views\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"name\":\"CodexWorld\",\"description\":\"Web &amp; Mobile App Development Company\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codexworld.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\",\"name\":\"CodexWorld\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"width\":200,\"height\":19,\"caption\":\"CodexWorld\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldweb\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/codexworld\",\"https:\\\/\\\/www.youtube.com\\\/codexworld\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\",\"name\":\"CodexWorld\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"caption\":\"CodexWorld\"},\"description\":\"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.\",\"sameAs\":[\"http:\\\/\\\/www.codexworld.com\",\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldblog\"],\"url\":\"https:\\\/\\\/www.codexworld.com\\\/author\\\/nitya192265\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WordPress - How to Display Most Popular Posts by Views - CodexWorld","description":"WordPress Most Popular Posts without Plugin \u2013 Learn how to display most popular posts by views in WordPress. WordPress most viewed posts query to get most popular posts.","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.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/","og_locale":"en_US","og_type":"article","og_title":"WordPress - How to Display Most Popular Posts by Views - CodexWorld","og_description":"WordPress Most Popular Posts without Plugin \u2013 Learn how to display most popular posts by views in WordPress. WordPress most viewed posts query to get most popular posts.","og_url":"https:\/\/www.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/","og_site_name":"CodexWorld","article_publisher":"https:\/\/www.facebook.com\/codexworld","article_author":"https:\/\/www.facebook.com\/codexworld","article_published_time":"2015-12-07T18:47:16+00:00","article_modified_time":"2015-12-07T18:50:40+00:00","og_image":[{"width":601,"height":449,"url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld.png","type":"image\/png"}],"author":"CodexWorld","twitter_card":"summary_large_image","twitter_creator":"@codexworldblog","twitter_site":"@codexworldweb","twitter_misc":{"Written by":"CodexWorld","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/#article","isPartOf":{"@id":"https:\/\/www.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/"},"author":{"name":"CodexWorld","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0"},"headline":"WordPress &#8211; How to Display Most Popular Posts by Views","datePublished":"2015-12-07T18:47:16+00:00","dateModified":"2015-12-07T18:50:40+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/"},"wordCount":193,"commentCount":5,"publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"image":{"@id":"https:\/\/www.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld.png","keywords":["Posts","WordPress"],"articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/","url":"https:\/\/www.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/","name":"WordPress - How to Display Most Popular Posts by Views - CodexWorld","isPartOf":{"@id":"https:\/\/www.codexworld.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/#primaryimage"},"image":{"@id":"https:\/\/www.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld.png","datePublished":"2015-12-07T18:47:16+00:00","dateModified":"2015-12-07T18:50:40+00:00","description":"WordPress Most Popular Posts without Plugin \u2013 Learn how to display most popular posts by views in WordPress. WordPress most viewed posts query to get most popular posts.","breadcrumb":{"@id":"https:\/\/www.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/#primaryimage","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld.png","width":601,"height":449,"caption":"wordpress-how-to-display-most-popular-posts-by-views-by-codexworld"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codexworld.com\/wordpress-how-to-display-most-popular-posts-by-views\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codexworld.com\/"},{"@type":"ListItem","position":2,"name":"WordPress &#8211; How to Display Most Popular Posts by Views"}]},{"@type":"WebSite","@id":"https:\/\/www.codexworld.com\/#website","url":"https:\/\/www.codexworld.com\/","name":"CodexWorld","description":"Web &amp; Mobile App Development Company","publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codexworld.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codexworld.com\/#organization","name":"CodexWorld","url":"https:\/\/www.codexworld.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","width":200,"height":19,"caption":"CodexWorld"},"image":{"@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldweb","https:\/\/www.linkedin.com\/company\/codexworld","https:\/\/www.youtube.com\/codexworld"]},{"@type":"Person","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0","name":"CodexWorld","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","caption":"CodexWorld"},"description":"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.","sameAs":["http:\/\/www.codexworld.com","https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldblog"],"url":"https:\/\/www.codexworld.com\/author\/nitya192265\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/12\/wordpress-how-to-display-most-popular-posts-by-views-by-codexworld.png","jetpack_shortlink":"https:\/\/wp.me\/p6bxIh-hz","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/1089","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/comments?post=1089"}],"version-history":[{"count":3,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/1089\/revisions"}],"predecessor-version":[{"id":1094,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/1089\/revisions\/1094"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media\/1091"}],"wp:attachment":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media?parent=1089"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/categories?post=1089"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/tags?post=1089"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}