{"id":1342,"date":"2013-07-08T19:24:08","date_gmt":"2013-07-08T19:24:08","guid":{"rendered":"http:\/\/garysieling.com\/blog\/?p=1342"},"modified":"2013-07-08T19:24:08","modified_gmt":"2013-07-08T19:24:08","slug":"optimizing-wordpress-tag-pages","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/optimizing-wordpress-tag-pages\/","title":{"rendered":"Optimizing WordPress Tag Pages"},"content":{"rendered":"<p>Normally I don&#8217;t like to write about &#8220;blogging,&#8221; but since website traffic generates some interesting data, it&#8217;s worth looking at it from a computer science perspective, to see the issues involved.<\/p>\n<p>By default, WordPress has two multi-valued fields associated with an article, &#8220;Categories&#8221; and &#8220;Tags.&#8221; Categories are treated as a closed, hierarchical set, and tags are an open, flat set. The software uses these and other attributes to generate lots of pages of dubious value (date-based archives, for instance). Coming up with the &#8220;right&#8221; tags is a bit of a puzzle, and I find my needs changing with time. For instance one might use this to tag posts with phrases not in the post that have some SEO value, or one might use it to generate a table of contents style index. Consider for instance the &#8220;Antiques&#8221; page on About.com:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1343\" alt=\"about\" src=\"http:\/\/garysieling.com\/blog\/wp-content\/uploads\/2013\/07\/about-578x525.png\" width=\"578\" height=\"525\" \/><\/p>\n<p>By default the \/tag\/[tag name] pages in WordPress are lists of posts, which is a poor choice, considering the amount of scrolling involved. Recently I made a few changes, modifying the URL from &#8220;\/tag\/[item]&#8221; to &#8220;\/examples\/[item],&#8221; which made it easy to separate the data:<\/p>\n<p>Before:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1344\" alt=\"tag-tag\" src=\"http:\/\/garysieling.com\/blog\/wp-content\/uploads\/2013\/07\/tag-tag-578x63.png\" width=\"578\" height=\"63\" \/><br \/>\nAfter:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1345\" alt=\"examples-tag\" src=\"http:\/\/garysieling.com\/blog\/wp-content\/uploads\/2013\/07\/examples-tag-578x74.png\" width=\"578\" height=\"74\" \/><\/p>\n<p>I made simple modifications to the title boxes on the page:<\/p>\n<pre lang=\"php\">function get_custom_title($value) {\n  $result = '';\n  $value = trim(strtolower($value));\n  if ($value == 'extjs examples' or\n    $value == 'extjs 4 examples'\n  ) {\n    $result = ucwords($value);\n  } else {\n    $result = \"Gary's Guide To \" . $result = ucwords($value);\n  }\n\n  $result = str_replace(\"Extjs\", \"Ext JS\", $result);\n  $result = str_replace(\"Ext Js\", \"Ext JS\", $result);\n  $result = str_replace(\"Nlp\", \"Natural Language Processing\", $result);\n\n  return $result;\n}<\/pre>\n<p>Similarly, I also added an introductory paragraph to each page (a generated sentence by default, or a paragraph for pages I care about). Each page now has a table of contents at the top, followed by post summaries, which you can see on the <a href=\"http:\/\/www.garysieling.com\/blog\/examples\/scraping\">page about scraping<\/a>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1348\" alt=\"scraping\" src=\"http:\/\/garysieling.com\/blog\/wp-content\/uploads\/2013\/07\/scraping-578x486.png\" width=\"578\" height=\"486\" \/><\/p>\n<p>Even though this still looks awful, you can see a noticeable boost in the metrics:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1351\" alt=\"metrics-before\" src=\"http:\/\/garysieling.com\/blog\/wp-content\/uploads\/2013\/07\/metrics-before1-578x56.png\" width=\"578\" height=\"56\" \/><\/p>\n<p>After:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1350\" alt=\"metrics-after\" src=\"http:\/\/garysieling.com\/blog\/wp-content\/uploads\/2013\/07\/metrics-after-578x34.png\" width=\"578\" height=\"34\" \/><\/p>\n<p>It looks like people are finding something useful and clicking away to it much quicker, since time on page and bounce rate are a lot lower (% exit is determined by how many visitors leave from this page vs the rest of the site &#8211; this is likely more dependent where people are landing when they start on my site). At this point there isn&#8217;t enough data to say much about per page numbers (considering that visits drop off exponentially, only the top two or three are meaningful). The best way to improve these pages now is likely to improve the selection of content, followed by better introductory text and article summaries, as well as fixing rendering issues.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Normally I don&#8217;t like to write about &#8220;blogging,&#8221; but since website traffic generates some interesting data, it&#8217;s worth looking at it from a computer science perspective, to see the issues involved. By default, WordPress has two multi-valued fields associated with an article, &#8220;Categories&#8221; and &#8220;Tags.&#8221; Categories are treated as a closed, hierarchical set, and tags &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.garysieling.com\/blog\/optimizing-wordpress-tag-pages\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Optimizing WordPress Tag Pages&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[432,535,601],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/1342"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=1342"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/1342\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=1342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=1342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=1342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}