{"id":21312,"date":"2012-07-13T08:21:22","date_gmt":"2012-07-13T12:21:22","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=21312"},"modified":"2016-03-21T06:20:44","modified_gmt":"2016-03-21T10:20:44","slug":"wordpress-how-to-change-custom-post-type-slug","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/wordpress-how-to-change-custom-post-type-slug.html","title":{"rendered":"CherryFramework 3. How to change custom post type slug"},"content":{"rendered":"<p>\r\n<\/p>\r\n<p>In this tutorial you will learn the way to change custom post type slug.<\/p>\r\n<p>Most of templates have custom post types &#8211; like slider or portfolio menu buttons in admin panel<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2012\/07\/wordpress_changing_custom_post_type_slug1.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2012\/07\/wordpress_changing_custom_post_type_slug1-300x175.jpg\" alt=\"\" width=\"300\" height=\"175\" class=\"alignnone size-medium wp-image-21313\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/07\/wordpress_changing_custom_post_type_slug1-300x175.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/07\/wordpress_changing_custom_post_type_slug1.jpg 335w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<p>When you open such types of posts you have special slug in post URL, we will change it in the tutorial.<\/p>\r\n<p><strong>1)<\/strong> Open your FTP or Cpanel and locate folder <strong>wp-content<\/strong>. Open it, then open folder &#8220;themes&#8221; and your theme folder. <\/p>\r\n<p><strong>2)<\/strong> Now you can open folder <strong>&#8220;includes&#8221;<\/strong> and locate &#8220;<strong>theme-init.php<\/strong>&#8221; file in there. You need to edit this file in any editor.<\/p>\r\n<p><strong>3) <\/strong>You can locate all post types and slugs in file <strong>theme-init.php<\/strong>. All the file content is split into logical block and it will be easy to navigate it. You can also use search feature and just search for slug you need to update.<\/p>\r\n<p><strong>4)<\/strong> Locate and replace post type slug with any slug you need, try not to use spaces.<\/p>\r\n<p>The script should look like:<\/p>\r\n<pre class=\"brush:php\">'slug' =&gt; 'portfolio-view'<\/pre>\r\n<p><strong>5)<\/strong> Save the file and test your website.<\/p>\r\n<p><strong>6)<\/strong> Sometimes you may get 404 error after changing custom post type slug, it is related to permalinks issue. You need to open admin panel, change permalings structure to default, save website and then revert it to previous state.<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2012\/07\/wordpress_changing_custom_post_type_slug2.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2012\/07\/wordpress_changing_custom_post_type_slug2-300x104.jpg\" alt=\"\" width=\"300\" height=\"104\" class=\"alignnone size-medium wp-image-21314\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/07\/wordpress_changing_custom_post_type_slug2-300x104.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/07\/wordpress_changing_custom_post_type_slug2.jpg 636w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<p>Feel free to check the detailed video tutorial below:<\/p>\r\n<p><a href=\"\/help\/files\/wordpress\/wordpress_changing_custom_post_type_slug.htm\" target=\"blank\">WordPress. How to change custom post type slug<\/a><\/p>\r\n<\/p>\r\n<\/p>\r\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>In this tutorial you will learn the way to change custom post type slug.<\/p>\n","protected":false},"author":29,"featured_media":21317,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[728],"tags":[789,592,1322,2405],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/21312"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=21312"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/21312\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/21317"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=21312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=21312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=21312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}