{"id":264,"date":"2018-10-02T16:41:30","date_gmt":"2018-10-02T16:41:30","guid":{"rendered":"https:\/\/jmrowe.com\/blog\/?p=264"},"modified":"2018-10-02T16:44:52","modified_gmt":"2018-10-02T16:44:52","slug":"wordpress-making-a-custom-type-not-have-a-url","status":"publish","type":"post","link":"https:\/\/jmrowe.com\/blog\/wordpress-making-a-custom-type-not-have-a-url\/","title":{"rendered":"WordPress &#8211; Making a custom type not have a url"},"content":{"rendered":"<p>Custom post type should have below settings:<\/p>\n<p>&#8216;rewrite&#8217; =&gt; false,<br \/>\n&#8216;query_var&#8217; =&gt; false,<br \/>\n&#8216;publicly_queryable&#8217; =&gt; false,<br \/>\n&#8216;public&#8217; =&gt; false<\/p>\n<p>Explanation of each:<\/p>\n<blockquote><p><strong><code>rewrite<\/code><\/strong>\u00a0Triggers the handling of rewrites for this post type. To prevent rewrites, set to false.<\/p>\n<p><strong><code>query_var<\/code><\/strong>\u00a0&#8216;false&#8217; &#8211; Disables query_var key use. A post type cannot be loaded at \/?{query_var}={single_post_slug}<\/p>\n<p><strong><code>publicly_queryable<\/code><\/strong>\u00a0Whether queries can be performed on the front end as part of parse_request().<\/p>\n<p><strong><code>public<\/code><\/strong>\u00a0&#8216;false&#8217; &#8211; Post type is not intended to be used publicly and should generally be unavailable in wp-admin and on the front end unless explicitly planned for elsewhere.<\/p><\/blockquote>\n<p>Go to\u00a0<strong>Permalinks Settings<\/strong>\u00a0and without changing anything &#8211; save change. It will rebuild your &#8220;routing&#8221;.<\/p>\n<p>Source: https:\/\/stackoverflow.com\/questions\/19747096\/remove-url-structure-for-custom-post-type<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Custom post type should have below settings: &#8216;rewrite&#8217; =&gt; false, &#8216;query_var&#8217; =&gt; false, &#8216;publicly_queryable&#8217; =&gt; false, &#8216;public&#8217; =&gt; false Explanation of each: rewrite\u00a0Triggers the handling of rewrites for this post type. To prevent rewrites, set to false. query_var\u00a0&#8216;false&#8217; &#8211; Disables query_var key use. A post type cannot be loaded at \/?{query_var}={single_post_slug} publicly_queryable\u00a0Whether queries can be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-264","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/posts\/264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/comments?post=264"}],"version-history":[{"count":3,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/posts\/264\/revisions"}],"predecessor-version":[{"id":269,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/posts\/264\/revisions\/269"}],"wp:attachment":[{"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/media?parent=264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/categories?post=264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/tags?post=264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}