{"id":5100,"date":"2022-11-06T19:13:53","date_gmt":"2022-11-06T06:13:53","guid":{"rendered":"https:\/\/www.zoyinc.com\/?p=5100"},"modified":"2022-11-06T19:13:57","modified_gmt":"2022-11-06T06:13:57","slug":"new-categories-cant-be-added-to-post","status":"publish","type":"post","link":"http:\/\/www.zoyinc.com\/?p=5100","title":{"rendered":"New categories can&#8217;t be added to post"},"content":{"rendered":"\n<p>I have now found that if I add a new category in WordPress I can&#8217;t add it to my posts. For example I have added the top level category &#8220;Trains&#8221; and a category beneath that &#8220;Wrapped Trains&#8221;:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a  href=\"https:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image.png\" class=\"thickbox no_icon\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image.png\" alt=\"\" class=\"wp-image-5101\" width=\"753\" height=\"283\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image.png 1217w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-300x113.png 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-150x57.png 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-768x290.png 768w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-500x189.png 500w\" sizes=\"auto, (max-width: 753px) 100vw, 753px\" \/><\/a><\/figure>\n\n\n\n<p>However if I try to select &#8220;Wrapped Trains&#8221; it isn&#8217;t in the list of categories:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"266\" height=\"315\" src=\"https:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-1.png\" alt=\"\" class=\"wp-image-5102\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-1.png 266w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-1-253x300.png 253w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-1-127x150.png 127w\" sizes=\"auto, (max-width: 266px) 100vw, 266px\" \/><\/figure>\n\n\n\n<p>In fact before I applied the below work around even &#8220;Trains&#8221; didn&#8217;t appear.<\/p>\n\n\n\n<p>FYI: I was running PHP 7.3 although 7.4 was the recommended. Otherwise all up to date. This was done 6\/11\/2022<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Workaround<\/h2>\n\n\n\n<p>From &#8220;Posts | All Posts&#8221; select the post in question<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a  href=\"https:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-3.png\" class=\"thickbox no_icon\" title=\"\"><img loading=\"lazy\" decoding=\"async\" width=\"918\" height=\"320\" src=\"https:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-3.png\" alt=\"\" class=\"wp-image-5105\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-3.png 918w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-3-300x105.png 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-3-150x52.png 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-3-768x268.png 768w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-3-500x174.png 500w\" sizes=\"auto, (max-width: 918px) 100vw, 918px\" \/><\/a><\/figure>\n\n\n\n<p>Then, under &#8220;Bulk actions&#8221; select &#8220;Edit&#8221; and click Apply<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a  href=\"https:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-4.png\" class=\"thickbox no_icon\" title=\"\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"226\" src=\"https:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-4.png\" alt=\"\" class=\"wp-image-5106\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-4.png 320w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-4-300x212.png 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-4-150x106.png 150w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><\/figure>\n\n\n\n<p>In the edit screen select the category you want, &#8220;Wrapped Trains&#8221; and then &#8220;Update&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a  href=\"https:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-5.png\" class=\"thickbox no_icon\" title=\"\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"650\" src=\"https:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-5.png\" alt=\"\" class=\"wp-image-5107\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-5.png 940w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-5-300x207.png 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-5-150x104.png 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-5-768x531.png 768w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-5-434x300.png 434w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/a><\/figure>\n\n\n\n<p>Refresh your post and you should find the new category selected:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"265\" height=\"242\" src=\"https:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-6.png\" alt=\"\" class=\"wp-image-5108\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-6.png 265w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2022\/11\/image-6-150x137.png 150w\" sizes=\"auto, (max-width: 265px) 100vw, 265px\" \/><\/figure>\n\n\n\n<p>You will now also find that the category is now available for new posts.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Things tried<\/h1>\n\n\n\n<p>Before the above workaround was done I had unsuccessfully tried:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Hard refresh of the browser <\/li>\n\n\n\n<li>Restarting the host the web server ran on<\/li>\n\n\n\n<li>Creating a new post &#8211; the category was displayed<\/li>\n\n\n\n<li>Deleting and recreated the category<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I have now found that if I add a new category in WordPress I can&#8217;t add it to my posts. For example I have added the top level category &#8220;Trains&#8221; and a category beneath that &#8220;Wrapped Trains&#8221;: However if I try to select &#8220;Wrapped Trains&#8221; it isn&#8217;t in the list of categories: In fact before [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":3696,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-5100","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress"],"_links":{"self":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/5100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5100"}],"version-history":[{"count":2,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/5100\/revisions"}],"predecessor-version":[{"id":5111,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/5100\/revisions\/5111"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/media\/3696"}],"wp:attachment":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5100"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}