{"id":2646,"date":"2026-10-01T17:15:14","date_gmt":"2026-10-01T11:45:14","guid":{"rendered":"https:\/\/ehostpiya.in\/blog\/?p=2646"},"modified":"2026-10-01T17:15:17","modified_gmt":"2026-10-01T11:45:17","slug":"how-to-create-a-custom-post-type-in-wordpress","status":"publish","type":"post","link":"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/","title":{"rendered":"How to Create a Custom Post Type in WordPress?"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_88 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#How_to_Create_a_Custom_Post_Type_in_WordPress\" >How to Create a Custom Post Type in WordPress<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#What_Is_a_Custom_Post_Type\" >What Is a Custom Post Type?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Why_Use_Custom_Post_Types\" >Why Use Custom Post Types?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Custom_Post_Type_vs_Regular_Post\" >Custom Post Type vs Regular Post<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Method_1_Create_a_Custom_Post_Type_Using_PHP\" >Method 1: Create a Custom Post Type Using PHP<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Understanding_register_post_type\" >Understanding register_post_type()<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Choosing_a_Post_Type_Slug\" >Choosing a Post Type Slug<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Creating_Custom_Labels\" >Creating Custom Labels<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Making_the_Post_Type_Public\" >Making the Post Type Public<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Adding_an_Archive_Page\" >Adding an Archive Page<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Adding_a_Featured_Image\" >Adding a Featured Image<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Enabling_the_WordPress_Block_Editor\" >Enabling the WordPress Block Editor<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Adding_a_Custom_Menu_Icon\" >Adding a Custom Menu Icon<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Creating_Custom_URLs\" >Creating Custom URLs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Flush_Permalinks_After_Creating_a_Post_Type\" >Flush Permalinks After Creating a Post Type<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Method_2_Create_a_Custom_Post_Type_With_a_Plugin\" >Method 2: Create a Custom Post Type With a Plugin<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Adding_a_Custom_Taxonomy\" >Adding a Custom Taxonomy<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Categories_vs_Tags_for_Custom_Post_Types\" >Categories vs Tags for Custom Post Types<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Adding_Custom_Fields\" >Adding Custom Fields<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Creating_a_Custom_Post_Type_Template\" >Creating a Custom Post Type Template<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Example_single-servicesphp\" >Example single-services.php<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Custom_Post_Type_and_SEO\" >Custom Post Type and SEO<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Custom_Post_Types_and_WordPress_REST_API\" >Custom Post Types and WordPress REST API<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Common_Custom_Post_Type_Mistakes\" >Common Custom Post Type Mistakes<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#1_Using_an_Existing_Post_Type_Name\" >1. Using an Existing Post Type Name<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#2_Using_an_Unclear_Slug\" >2. Using an Unclear Slug<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#3_Forgetting_show_in_rest\" >3. Forgetting show_in_rest<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#4_Forgetting_to_Refresh_Permalinks\" >4. Forgetting to Refresh Permalinks<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#5_Registering_the_Post_Type_in_the_Wrong_Place\" >5. Registering the Post Type in the Wrong Place<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#6_Creating_Too_Many_Post_Types\" >6. Creating Too Many Post Types<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Custom_Post_Type_Best_Practices\" >Custom Post Type Best Practices<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#When_Should_You_Use_a_Custom_Post_Type\" >When Should You Use a Custom Post Type?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-33\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#Final_Thoughts\" >Final Thoughts<\/a><\/li><\/ul><\/nav><\/div>\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Create_a_Custom_Post_Type_in_WordPress\"><\/span>How to Create a Custom Post Type in WordPress<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress was originally designed around publishing posts and pages, but modern websites often need to manage different types of content. A business website might need <strong>Services<\/strong>, <strong>Products<\/strong>, <strong>Team Members<\/strong>, <strong>Testimonials<\/strong>, or <strong>Case Studies<\/strong>, while a directory website may require listings or locations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instead of storing all this information as regular posts, WordPress allows developers to create <strong>Custom Post Types (CPTs)<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A custom post type gives you a dedicated area in the WordPress Dashboard for managing a specific type of content. In this guide, we&#8217;ll explore what custom post types are, why they are useful, and several ways to create one safely.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Is_a_Custom_Post_Type\"><\/span>What Is a Custom Post Type?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A custom post type is a content type that extends WordPress beyond its default <strong>Posts<\/strong> and <strong>Pages<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, imagine a web hosting company wants to publish information about its hosting services. Instead of putting everything under regular blog posts, it could create a custom post type called:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Services<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The Dashboard could then contain:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Dashboard\n\u251c\u2500\u2500 Posts\n\u251c\u2500\u2500 Pages\n\u251c\u2500\u2500 Media\n\u251c\u2500\u2500 Services\n\u2502   \u251c\u2500\u2500 Add New\n\u2502   \u251c\u2500\u2500 All Services\n\u2502   \u2514\u2500\u2500 Service Categories\n\u2514\u2500\u2500 Settings<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Each service could have its own title, description, featured image, and other custom information.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Use_Custom_Post_Types\"><\/span>Why Use Custom Post Types?<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Custom post types are useful when your website contains content that has a different purpose or structure from normal blog posts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Common examples include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Products<\/li>\n\n\n\n<li>Services<\/li>\n\n\n\n<li>Team members<\/li>\n\n\n\n<li>Testimonials<\/li>\n\n\n\n<li>Portfolio projects<\/li>\n\n\n\n<li>Case studies<\/li>\n\n\n\n<li>Events<\/li>\n\n\n\n<li>Courses<\/li>\n\n\n\n<li>Properties<\/li>\n\n\n\n<li>Job listings<\/li>\n\n\n\n<li>Locations<\/li>\n\n\n\n<li>Books<\/li>\n\n\n\n<li>Recipes<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Posts \u2192 Blog articles\nPages \u2192 Static website content\nProducts \u2192 Items offered for sale\nServices \u2192 Services provided by a business\nProjects \u2192 Portfolio work<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This separation makes content easier to manage and organize.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Custom_Post_Type_vs_Regular_Post\"><\/span>Custom Post Type vs Regular Post<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">A regular WordPress post is designed primarily for chronological content such as blog articles.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A custom post type is designed for a specific content category.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Feature<\/th><th>Regular Post<\/th><th>Custom Post Type<\/th><\/tr><\/thead><tbody><tr><td>Blog articles<\/td><td>Yes<\/td><td>Possible<\/td><\/tr><tr><td>Custom content structure<\/td><td>Limited<\/td><td>Yes<\/td><\/tr><tr><td>Separate Dashboard section<\/td><td>No<\/td><td>Yes<\/td><\/tr><tr><td>Custom taxonomies<\/td><td>Yes<\/td><td>Yes<\/td><\/tr><tr><td>Custom fields<\/td><td>Yes<\/td><td>Yes<\/td><\/tr><tr><td>Custom templates<\/td><td>Yes<\/td><td>Yes<\/td><\/tr><tr><td>Custom URLs<\/td><td>Yes<\/td><td>Yes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Method_1_Create_a_Custom_Post_Type_Using_PHP\"><\/span>Method 1: Create a Custom Post Type Using PHP<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">One of the most flexible ways to create a custom post type is with PHP.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, let&#8217;s create a <strong>Services<\/strong> post type.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The code can be placed in a custom plugin or, for theme-specific functionality, a child theme.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function my_register_services_post_type() {\n\n    register_post_type('services', array(\n        'labels' =&gt; array(\n            'name' =&gt; 'Services',\n            'singular_name' =&gt; 'Service',\n            'add_new' =&gt; 'Add New Service',\n            'add_new_item' =&gt; 'Add New Service',\n            'edit_item' =&gt; 'Edit Service',\n            'new_item' =&gt; 'New Service',\n            'view_item' =&gt; 'View Service',\n            'search_items' =&gt; 'Search Services',\n            'not_found' =&gt; 'No services found',\n            'menu_name' =&gt; 'Services'\n        ),\n\n        'public' =&gt; true,\n        'has_archive' =&gt; true,\n        'menu_icon' =&gt; 'dashicons-admin-tools',\n\n        'supports' =&gt; array(\n            'title',\n            'editor',\n            'thumbnail',\n            'excerpt'\n        ),\n\n        'rewrite' =&gt; array(\n            'slug' =&gt; 'services'\n        ),\n\n        'show_in_rest' =&gt; true\n    ));\n}\n\nadd_action('init', 'my_register_services_post_type');<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After adding the code, visit your WordPress Dashboard.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should see a new:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Services<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">section.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Understanding_register_post_type\"><\/span>Understanding <code>register_post_type()<\/code><span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">The primary WordPress function used to create a custom post type is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>register_post_type()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It tells WordPress what your new content type should be called and how it should behave.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>register_post_type('services', $args);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>services<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">is the post type&#8217;s internal identifier.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Choosing_a_Post_Type_Slug\"><\/span>Choosing a Post Type Slug<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">The first parameter should be a suitable identifier.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>register_post_type('services', ...)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Good identifiers are:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>services\nproducts\nprojects\nevents\nteam<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Avoid unnecessarily long or confusing identifiers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The post type key should also follow WordPress&#8217;s naming restrictions and should not conflict with an existing post type.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Creating_Custom_Labels\"><\/span>Creating Custom Labels<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Labels control the text displayed throughout the WordPress Dashboard.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'labels' =&gt; array(\n    'name' =&gt; 'Services',\n    'singular_name' =&gt; 'Service',\n    'add_new' =&gt; 'Add New',\n    'add_new_item' =&gt; 'Add New Service',\n    'edit_item' =&gt; 'Edit Service',\n    'view_item' =&gt; 'View Service',\n    'search_items' =&gt; 'Search Services',\n)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can customize these labels to match your content type.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a product post type, for example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Products\nAdd New Product\nEdit Product\nView Product\nSearch Products<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Making_the_Post_Type_Public\"><\/span>Making the Post Type Public<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">This option controls whether the post type is generally available on the frontend.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'public' =&gt; true,<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Setting it to <code>true<\/code> makes the content publicly accessible, subject to the other registration settings.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For an internal content type that should not have public pages, you can configure the post type differently.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Adding_an_Archive_Page\"><\/span>Adding an Archive Page<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">You can enable an archive page using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'has_archive' =&gt; true,<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For example, if the post type uses the slug:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>services<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress can provide an archive URL such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>example.com\/services\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The exact URL depends on your site&#8217;s permalink and rewrite configuration.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Adding_a_Featured_Image\"><\/span>Adding a Featured Image<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">If you want each custom post to support a featured image, add:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'supports' =&gt; array(\n    'title',\n    'editor',\n    'thumbnail'\n),<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>thumbnail<\/code> option enables the featured image functionality.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Other commonly used options include:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>title\neditor\nauthor\nthumbnail\nexcerpt\ncomments\nrevisions\ncustom-fields\npage-attributes<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Only enable the features your content actually needs.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Enabling_the_WordPress_Block_Editor\"><\/span>Enabling the WordPress Block Editor<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">To make the custom post type compatible with the WordPress block editor and REST API, include:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'show_in_rest' =&gt; true,<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is particularly important for modern WordPress workflows.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Adding_a_Custom_Menu_Icon\"><\/span>Adding a Custom Menu Icon<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">You can customize the Dashboard icon:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'menu_icon' =&gt; 'dashicons-admin-tools',<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress includes a collection of Dashicons that can be used for administrative menus.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Choose an icon that makes sense for the content type.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Creating_Custom_URLs\"><\/span>Creating Custom URLs<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">You can specify the URL structure using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'rewrite' =&gt; array(\n    'slug' =&gt; 'services'\n),<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This can produce URLs such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>example.com\/services\/web-hosting\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">instead of exposing the internal post type name in an undesirable format.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Flush_Permalinks_After_Creating_a_Post_Type\"><\/span>Flush Permalinks After Creating a Post Type<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Sometimes your custom post type URL may produce a 404 error immediately after registration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Go to:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Settings \u2192 Permalinks<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then click:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Save Changes<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You don&#8217;t necessarily need to change any settings. Saving the permalink settings refreshes WordPress&#8217;s rewrite rules.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For plugins, you can also handle rewrite-rule flushing during activation\/deactivation rather than flushing them on every request.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Method_2_Create_a_Custom_Post_Type_With_a_Plugin\"><\/span>Method 2: Create a Custom Post Type With a Plugin<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">If you don&#8217;t want to write PHP, you can use a plugin that provides a graphical interface for creating custom post types.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The general process is:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open <strong>Plugins \u2192 Add New Plugin<\/strong>.<\/li>\n\n\n\n<li>Search for a reputable custom-post-type management plugin.<\/li>\n\n\n\n<li>Install and activate it.<\/li>\n\n\n\n<li>Open its post-type management interface.<\/li>\n\n\n\n<li>Choose <strong>Add New Post Type<\/strong>.<\/li>\n\n\n\n<li>Enter the post type name and labels.<\/li>\n\n\n\n<li>Select supported features.<\/li>\n\n\n\n<li>Configure visibility and URLs.<\/li>\n\n\n\n<li>Save the post type.<\/li>\n\n\n\n<li>Test it from the WordPress Dashboard.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">This approach can be useful for site owners who aren&#8217;t comfortable editing PHP.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Adding_a_Custom_Taxonomy\"><\/span>Adding a Custom Taxonomy<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">A custom post type can also have its own taxonomy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, a <strong>Services<\/strong> post type could have categories such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Web Hosting\nVPS Hosting\nDedicated Servers\nWordPress Hosting\nDomain Services<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can register a custom taxonomy using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function my_register_service_taxonomy() {\n\n    register_taxonomy(\n        'service_category',\n        'services',\n        array(\n            'label' =&gt; 'Service Categories',\n            'public' =&gt; true,\n            'hierarchical' =&gt; true,\n            'show_in_rest' =&gt; true\n        )\n    );\n\n}\n\nadd_action('init', 'my_register_service_taxonomy');<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Because <code>hierarchical<\/code> is set to <code>true<\/code>, the taxonomy behaves similarly to standard WordPress categories.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Categories_vs_Tags_for_Custom_Post_Types\"><\/span>Categories vs Tags for Custom Post Types<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">You can also use non-hierarchical taxonomies, which behave more like tags.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'hierarchical' =&gt; false,<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is useful for characteristics such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Linux\nSSD\nManaged\nCloud\nBeginner\nBusiness<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A simple distinction is:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Hierarchical taxonomy:<\/strong> categories and parent\/child relationships.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Non-hierarchical taxonomy:<\/strong> tags or labels without a hierarchy.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Adding_Custom_Fields\"><\/span>Adding Custom Fields<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Sometimes a title and editor aren&#8217;t enough.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A service might need additional information such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Price<\/li>\n\n\n\n<li>Server location<\/li>\n\n\n\n<li>Storage<\/li>\n\n\n\n<li>RAM<\/li>\n\n\n\n<li>Bandwidth<\/li>\n\n\n\n<li>Service duration<\/li>\n\n\n\n<li>Call-to-action URL<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">These additional pieces of information can be stored as <strong>custom fields<\/strong> or managed using a custom-fields solution.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Service Name: VPS Basic\nPrice: \u20b9499\/month\nStorage: 50 GB\nRAM: 4 GB\nLocation: India<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A custom post type combined with custom fields can create a structured content-management system inside WordPress.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Creating_a_Custom_Post_Type_Template\"><\/span>Creating a Custom Post Type Template<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress supports specialized templates for custom post types.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a post type called:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>services<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">you can create:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>single-services.php<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">for individual service pages.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can also create:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>archive-services.php<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">for the service archive page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A typical structure might look like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>your-theme\/\n\u251c\u2500\u2500 single-services.php\n\u251c\u2500\u2500 archive-services.php\n\u2514\u2500\u2500 style.css<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;re customizing a theme, use a child theme when appropriate so that your changes aren&#8217;t overwritten by parent-theme updates.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_single-servicesphp\"><\/span>Example <code>single-services.php<\/code><span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">A simple template could look like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php get_header(); ?&gt;\n\n&lt;main class=\"services-content\"&gt;\n\n    &lt;?php\n    while (have_posts()) :\n        the_post();\n    ?&gt;\n\n        &lt;article&gt;\n            &lt;h1&gt;&lt;?php the_title(); ?&gt;&lt;\/h1&gt;\n\n            &lt;?php if (has_post_thumbnail()) : ?&gt;\n                &lt;?php the_post_thumbnail('large'); ?&gt;\n            &lt;?php endif; ?&gt;\n\n            &lt;div class=\"service-description\"&gt;\n                &lt;?php the_content(); ?&gt;\n            &lt;\/div&gt;\n        &lt;\/article&gt;\n\n    &lt;?php endwhile; ?&gt;\n\n&lt;\/main&gt;\n\n&lt;?php get_footer(); ?&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This gives you control over how individual service pages are displayed.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Custom_Post_Type_and_SEO\"><\/span>Custom Post Type and SEO<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Custom post types can also be optimized for search engines.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Important areas include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SEO-friendly URLs<\/li>\n\n\n\n<li>Unique page titles<\/li>\n\n\n\n<li>Useful descriptions<\/li>\n\n\n\n<li>Structured content<\/li>\n\n\n\n<li>Internal links<\/li>\n\n\n\n<li>Optimized images<\/li>\n\n\n\n<li>Appropriate taxonomy pages<\/li>\n\n\n\n<li>XML sitemap inclusion<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Many SEO plugins can recognize custom post types and provide settings for controlling their search visibility.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before enabling indexing, make sure the content provides useful information and isn&#8217;t simply duplicate content from other pages.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Custom_Post_Types_and_WordPress_REST_API\"><\/span>Custom Post Types and WordPress REST API<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">If:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'show_in_rest' =&gt; true<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">is enabled, the post type can generally be exposed through the WordPress REST API.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This can be useful for:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>JavaScript applications<\/li>\n\n\n\n<li>Headless WordPress<\/li>\n\n\n\n<li>Mobile applications<\/li>\n\n\n\n<li>External integrations<\/li>\n\n\n\n<li>Custom frontend interfaces<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">A custom post type can therefore serve as a structured content source beyond the traditional WordPress theme.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Common_Custom_Post_Type_Mistakes\"><\/span>Common Custom Post Type Mistakes<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Using_an_Existing_Post_Type_Name\"><\/span>1. Using an Existing Post Type Name<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Don&#8217;t accidentally register a post type with a name already used by WordPress or another plugin.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Choose a unique identifier.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Using_an_Unclear_Slug\"><\/span>2. Using an Unclear Slug<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A slug such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>abc123<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">doesn&#8217;t provide much meaning.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use descriptive identifiers such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>services\nproducts\nprojects<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Forgetting_show_in_rest\"><\/span>3. Forgetting <code>show_in_rest<\/code><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you want block-editor and REST API compatibility, remember:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'show_in_rest' =&gt; true,<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Forgetting_to_Refresh_Permalinks\"><\/span>4. Forgetting to Refresh Permalinks<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If custom post URLs return 404 errors, visit:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Settings \u2192 Permalinks \u2192 Save Changes<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Registering_the_Post_Type_in_the_Wrong_Place\"><\/span>5. Registering the Post Type in the Wrong Place<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If the content should remain available when the theme changes, registering the post type in a custom plugin is generally preferable to putting it directly in the theme.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Otherwise, changing themes can make the custom content management interface disappear.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_Creating_Too_Many_Post_Types\"><\/span>6. Creating Too Many Post Types<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Not every type of content needs its own post type.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before creating one, consider whether a normal post, page, taxonomy, or custom field would solve the problem more simply.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Custom_Post_Type_Best_Practices\"><\/span>Custom Post Type Best Practices<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Follow these guidelines when creating custom post types:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Choose a clear and unique post type key.<\/strong><\/li>\n\n\n\n<li><strong>Use descriptive labels.<\/strong><\/li>\n\n\n\n<li><strong>Enable only the features you need.<\/strong><\/li>\n\n\n\n<li><strong>Use <code>show_in_rest<\/code> for modern WordPress workflows where appropriate.<\/strong><\/li>\n\n\n\n<li><strong>Use custom taxonomies when content needs additional organization.<\/strong><\/li>\n\n\n\n<li><strong>Use custom fields for structured information.<\/strong><\/li>\n\n\n\n<li><strong>Create dedicated templates when necessary.<\/strong><\/li>\n\n\n\n<li><strong>Keep custom functionality in a plugin if it shouldn&#8217;t depend on the theme.<\/strong><\/li>\n\n\n\n<li><strong>Refresh rewrite rules after changing URL structures.<\/strong><\/li>\n\n\n\n<li><strong>Test archive and individual URLs.<\/strong><\/li>\n\n\n\n<li><strong>Consider SEO before making the content publicly indexable.<\/strong><\/li>\n\n\n\n<li><strong>Back up the website before making structural changes.<\/strong><\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"When_Should_You_Use_a_Custom_Post_Type\"><\/span>When Should You Use a Custom Post Type?<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">A custom post type is a good choice when your website contains a distinct type of content that needs its own:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Dashboard section<\/li>\n\n\n\n<li>URL structure<\/li>\n\n\n\n<li>Templates<\/li>\n\n\n\n<li>Taxonomies<\/li>\n\n\n\n<li>Custom fields<\/li>\n\n\n\n<li>Search behavior<\/li>\n\n\n\n<li>Permissions<\/li>\n\n\n\n<li>Workflow<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For example, a web hosting company could organize its website like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Posts\n\u2514\u2500\u2500 Hosting Guides\n\nServices\n\u251c\u2500\u2500 Shared Hosting\n\u251c\u2500\u2500 VPS Hosting\n\u251c\u2500\u2500 Dedicated Servers\n\u2514\u2500\u2500 WordPress Hosting\n\nProjects\n\u251c\u2500\u2500 Project A\n\u251c\u2500\u2500 Project B\n\u2514\u2500\u2500 Project C<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is much easier to manage than putting unrelated content into one generic post list.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Final_Thoughts\"><\/span>Final Thoughts<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Custom post types are one of WordPress&#8217;s most useful features for building structured websites. They allow you to create dedicated content types that behave independently from standard posts and pages while still using the familiar WordPress editing environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For developers, registering a custom post type with <code>register_post_type()<\/code> provides extensive control over labels, URLs, templates, editor support, archives, and visibility. For non-developers, a reputable custom-post-type plugin can provide a simpler interface.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The key is to create custom post types only when they provide a genuine organizational or functional benefit. Combined with custom taxonomies, custom fields, dedicated templates, and appropriate SEO settings, they can turn WordPress into a flexible content-management platform for almost any type of website.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"How to Create a Custom Post Type in WordPress WordPress was originally designed around publishing posts and pages,&hellip;","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_display_header_overlay":false,"csco_singular_sidebar":"","csco_page_header_type":"","footnotes":""},"categories":[134],"tags":[],"class_list":["post-2646","post","type-post","status-publish","format-standard","category-wordpress-web-hosting","cs-entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Create a Custom Post Type in WordPress? - Web Hosting Blogs by Ehostpiya | Tips and Tricks<\/title>\n<meta name=\"description\" content=\"How to Create a Custom Post Type in WordPress? - Wordpress\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create a Custom Post Type in WordPress? - Web Hosting Blogs by Ehostpiya | Tips and Tricks\" \/>\n<meta property=\"og:description\" content=\"How to Create a Custom Post Type in WordPress? - Wordpress\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting Blogs by Ehostpiya | Tips and Tricks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/ehostpiya\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-01T11:45:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-01T11:45:17+00:00\" \/>\n<meta name=\"author\" content=\"Vandeeta\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vandeeta\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/how-to-create-a-custom-post-type-in-wordpress\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/how-to-create-a-custom-post-type-in-wordpress\\\/\"},\"author\":{\"name\":\"Vandeeta\",\"@id\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/#\\\/schema\\\/person\\\/7e99667266ef1b118ad734c1c035d796\"},\"headline\":\"How to Create a Custom Post Type in WordPress?\",\"datePublished\":\"2026-10-01T11:45:14+00:00\",\"dateModified\":\"2026-10-01T11:45:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/how-to-create-a-custom-post-type-in-wordpress\\\/\"},\"wordCount\":1676,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/#organization\"},\"articleSection\":[\"Wordpress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/how-to-create-a-custom-post-type-in-wordpress\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/how-to-create-a-custom-post-type-in-wordpress\\\/\",\"url\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/how-to-create-a-custom-post-type-in-wordpress\\\/\",\"name\":\"How to Create a Custom Post Type in WordPress? - Web Hosting Blogs by Ehostpiya | Tips and Tricks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/#website\"},\"datePublished\":\"2026-10-01T11:45:14+00:00\",\"dateModified\":\"2026-10-01T11:45:17+00:00\",\"description\":\"How to Create a Custom Post Type in WordPress? - Wordpress\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/how-to-create-a-custom-post-type-in-wordpress\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/how-to-create-a-custom-post-type-in-wordpress\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/how-to-create-a-custom-post-type-in-wordpress\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create a Custom Post Type in WordPress?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/\",\"name\":\"Web Hosting Blogs by Ehostpiya | Tips and Tricks\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/#organization\",\"name\":\"Web Hosting Blogs by Ehostpiya | Tips and Tricks\",\"url\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/512.png\",\"contentUrl\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/512.png\",\"width\":512,\"height\":512,\"caption\":\"Web Hosting Blogs by Ehostpiya | Tips and Tricks\"},\"image\":{\"@id\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/facebook.com\\\/ehostpiya\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/#\\\/schema\\\/person\\\/7e99667266ef1b118ad734c1c035d796\",\"name\":\"Vandeeta\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ee031298008d633e52bec71ce70d11a0b605dc666af42cdd52a950f061ad9f08?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ee031298008d633e52bec71ce70d11a0b605dc666af42cdd52a950f061ad9f08?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ee031298008d633e52bec71ce70d11a0b605dc666af42cdd52a950f061ad9f08?s=96&d=mm&r=g\",\"caption\":\"Vandeeta\"},\"sameAs\":[\"https:\\\/\\\/ehostpiya.in\\\/blog\"],\"url\":\"https:\\\/\\\/ehostpiya.in\\\/blog\\\/author\\\/ehostpiya_blog\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create a Custom Post Type in WordPress? - Web Hosting Blogs by Ehostpiya | Tips and Tricks","description":"How to Create a Custom Post Type in WordPress? - Wordpress","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"How to Create a Custom Post Type in WordPress? - Web Hosting Blogs by Ehostpiya | Tips and Tricks","og_description":"How to Create a Custom Post Type in WordPress? - Wordpress","og_url":"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/","og_site_name":"Web Hosting Blogs by Ehostpiya | Tips and Tricks","article_publisher":"https:\/\/facebook.com\/ehostpiya","article_published_time":"2026-10-01T11:45:14+00:00","article_modified_time":"2026-10-01T11:45:17+00:00","author":"Vandeeta","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Vandeeta","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#article","isPartOf":{"@id":"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/"},"author":{"name":"Vandeeta","@id":"https:\/\/ehostpiya.in\/blog\/#\/schema\/person\/7e99667266ef1b118ad734c1c035d796"},"headline":"How to Create a Custom Post Type in WordPress?","datePublished":"2026-10-01T11:45:14+00:00","dateModified":"2026-10-01T11:45:17+00:00","mainEntityOfPage":{"@id":"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/"},"wordCount":1676,"commentCount":0,"publisher":{"@id":"https:\/\/ehostpiya.in\/blog\/#organization"},"articleSection":["Wordpress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/","url":"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/","name":"How to Create a Custom Post Type in WordPress? - Web Hosting Blogs by Ehostpiya | Tips and Tricks","isPartOf":{"@id":"https:\/\/ehostpiya.in\/blog\/#website"},"datePublished":"2026-10-01T11:45:14+00:00","dateModified":"2026-10-01T11:45:17+00:00","description":"How to Create a Custom Post Type in WordPress? - Wordpress","breadcrumb":{"@id":"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ehostpiya.in\/blog\/how-to-create-a-custom-post-type-in-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ehostpiya.in\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Create a Custom Post Type in WordPress?"}]},{"@type":"WebSite","@id":"https:\/\/ehostpiya.in\/blog\/#website","url":"https:\/\/ehostpiya.in\/blog\/","name":"Web Hosting Blogs by Ehostpiya | Tips and Tricks","description":"","publisher":{"@id":"https:\/\/ehostpiya.in\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ehostpiya.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ehostpiya.in\/blog\/#organization","name":"Web Hosting Blogs by Ehostpiya | Tips and Tricks","url":"https:\/\/ehostpiya.in\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ehostpiya.in\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/ehostpiya.in\/blog\/wp-content\/uploads\/2026\/08\/512.png","contentUrl":"https:\/\/ehostpiya.in\/blog\/wp-content\/uploads\/2026\/08\/512.png","width":512,"height":512,"caption":"Web Hosting Blogs by Ehostpiya | Tips and Tricks"},"image":{"@id":"https:\/\/ehostpiya.in\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/ehostpiya"]},{"@type":"Person","@id":"https:\/\/ehostpiya.in\/blog\/#\/schema\/person\/7e99667266ef1b118ad734c1c035d796","name":"Vandeeta","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ee031298008d633e52bec71ce70d11a0b605dc666af42cdd52a950f061ad9f08?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ee031298008d633e52bec71ce70d11a0b605dc666af42cdd52a950f061ad9f08?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ee031298008d633e52bec71ce70d11a0b605dc666af42cdd52a950f061ad9f08?s=96&d=mm&r=g","caption":"Vandeeta"},"sameAs":["https:\/\/ehostpiya.in\/blog"],"url":"https:\/\/ehostpiya.in\/blog\/author\/ehostpiya_blog\/"}]}},"_links":{"self":[{"href":"https:\/\/ehostpiya.in\/blog\/wp-json\/wp\/v2\/posts\/2646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ehostpiya.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ehostpiya.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ehostpiya.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ehostpiya.in\/blog\/wp-json\/wp\/v2\/comments?post=2646"}],"version-history":[{"count":1,"href":"https:\/\/ehostpiya.in\/blog\/wp-json\/wp\/v2\/posts\/2646\/revisions"}],"predecessor-version":[{"id":2647,"href":"https:\/\/ehostpiya.in\/blog\/wp-json\/wp\/v2\/posts\/2646\/revisions\/2647"}],"wp:attachment":[{"href":"https:\/\/ehostpiya.in\/blog\/wp-json\/wp\/v2\/media?parent=2646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ehostpiya.in\/blog\/wp-json\/wp\/v2\/categories?post=2646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ehostpiya.in\/blog\/wp-json\/wp\/v2\/tags?post=2646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}