{"id":6450,"date":"2015-01-10T16:12:47","date_gmt":"2015-01-10T16:12:47","guid":{"rendered":"http:\/\/www.petestack.com\/blog\/?p=6450"},"modified":"2025-07-21T12:21:49","modified_gmt":"2025-07-21T11:21:49","slug":"permalinks-and-borked-settings","status":"publish","type":"post","link":"https:\/\/www.petestack.com\/blog\/permalinks-and-borked-settings.html","title":{"rendered":"Permalinks and borked settings"},"content":{"rendered":"<p>Last month (with many blog posts being filed under multiple categories and WordPress seemingly no longer respecting my chosen &#8216;main&#8217; category for the post URL) I decided to take the category name out of my custom &#8216;permalink&#8217; structure to change it from &#8216;https:\/\/www.petestack.com\/blog\/category\/postname.html&#8217; to &#8216;https:\/\/www.petestack.com\/blog\/postname.html&#8217;. Which would have been fine if that&#8217;s what I&#8217;d actually done, but I stupidly just selected the similar standard WordPress &#8216;post name&#8217; structure assuming that&#8217;s what it did and landed myself with &#8216;https:\/\/www.petestack.com\/blog\/postname\/&#8217; (see the difference?) instead&#8230;<!--more--> which worked fine for all new posts and WordPress-generated links to older ones but completely broke all the manually-entered links in nearly six years&#8217; worth of previous posts and comments! So, being aware that these links were broken but not why, I set about fixing them and ran a series of MySQL queries to strip the category names from &#8216;post_content&#8217;, &#8216;comment_content&#8217; and &#8216;comment_author_url&#8217; table columns. Which, despite correcting the URLs to what I thought I&#8217;d set up, was still baffling me this afternoon by not fixing the broken links. And then it hit me&#8230; the new &#8216;post name&#8217; format was not the same as just stripping the category from the one I&#8217;d had, and, having twigged that simple and now-so-obvious mistake, all should be hunky-dory again. I&#8217;ve even dealt with .htaccess redirects to take care of search-engine links to the old (category-inclusive) permalinks, so now just have to hope they&#8217;ve not got the whole blog reindexed too quickly with the December versions!<\/p>\n<p>Might just add that I&#8217;ve also taken this opportunity to retrospectively file many previously mislabelled &#8216;climbing&#8217; and &#8216;running&#8217; posts under the <a href=\"https:\/\/www.petestack.com\/blog\/last-of-the-monadh-ruadh.html\">new &#8216;walking&#8217; category<\/a> but, with my redirects taking care of the old category thing, shouldn&#8217;t have broken any older links from outwith the site by doing so.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last month (with many blog posts being filed under multiple categories and WordPress seemingly no longer respecting my chosen &#8216;main&#8217; category for the post URL) I decided to take the category name out of my custom &#8216;permalink&#8217; structure to change it from &#8216;https:\/\/www.petestack.com\/blog\/category\/postname.html&#8217; to &#8216;https:\/\/www.petestack.com\/blog\/postname.html&#8217;. Which would have been fine if that&#8217;s what I&#8217;d actually [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-6450","post","type-post","status-publish","format-standard","hentry","category-site"],"_links":{"self":[{"href":"https:\/\/www.petestack.com\/blog\/wp-json\/wp\/v2\/posts\/6450","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.petestack.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.petestack.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.petestack.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.petestack.com\/blog\/wp-json\/wp\/v2\/comments?post=6450"}],"version-history":[{"count":15,"href":"https:\/\/www.petestack.com\/blog\/wp-json\/wp\/v2\/posts\/6450\/revisions"}],"predecessor-version":[{"id":11725,"href":"https:\/\/www.petestack.com\/blog\/wp-json\/wp\/v2\/posts\/6450\/revisions\/11725"}],"wp:attachment":[{"href":"https:\/\/www.petestack.com\/blog\/wp-json\/wp\/v2\/media?parent=6450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.petestack.com\/blog\/wp-json\/wp\/v2\/categories?post=6450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.petestack.com\/blog\/wp-json\/wp\/v2\/tags?post=6450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}