{"id":150,"date":"2024-10-03T10:13:04","date_gmt":"2024-10-03T10:13:04","guid":{"rendered":"https:\/\/itxperts.co.in\/blog\/?p=150"},"modified":"2024-10-25T10:35:29","modified_gmt":"2024-10-25T10:35:29","slug":"how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts","status":"publish","type":"post","link":"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/","title":{"rendered":"How to Create Custom Post Types in WordPress: A Complete Guide by Itxperts"},"content":{"rendered":"\n<p>WordPress is known for its flexibility, and one of the most powerful features of this platform is <strong>Custom Post Types<\/strong> (CPTs). By default, WordPress comes with built-in post types like posts, pages, and attachments, but there are times when you need to create custom content types for more specific purposes. For instance, if you\u2019re building a portfolio website, a \u201cProjects\u201d custom post type would make sense, or if you\u2019re creating a real estate site, a \u201cProperties\u201d custom post type would be useful.<\/p>\n\n\n\n<p>This guide will walk you through creating a custom post type in WordPress, step by step.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is a Custom Post Type?<\/h3>\n\n\n\n<p>A <strong>Custom Post Type<\/strong> in WordPress is a way to organize and structure different types of content that don\u2019t fit into the default WordPress post types (such as blog posts and pages). CPTs allow you to extend WordPress and tailor it to your specific needs.<\/p>\n\n\n\n<p>For example, if you\u2019re creating a website for a movie review site, you might want a custom post type for \u201cMovies.\u201d Each movie post type could include fields like title, director, genre, release date, and so on.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Set Up Your Development Environment<\/h3>\n\n\n\n<p>Before starting, ensure you have access to your WordPress installation either on your local environment or live server. It\u2019s recommended to set up a local development environment for testing. You can use software like <strong>XAMPP<\/strong>, <strong>MAMP<\/strong>, or <strong>Local by Flywheel<\/strong> to create a local server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Register a Custom Post Type with Code<\/h3>\n\n\n\n<p>WordPress makes it easy to register a new custom post type using the <code>register_post_type()<\/code> function. You&#8217;ll need to add this function to your theme&#8217;s <code>functions.php<\/code> file or a custom plugin.<\/p>\n\n\n\n<p>Here\u2019s how you can register a custom post type called &#8220;Books&#8221;:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Open your theme\u2019s <code>functions.php<\/code> file<\/strong>:<br>Navigate to <code>wp-content\/themes\/your-theme\/functions.php<\/code> and open it for editing.<\/li>\n\n\n\n<li><strong>Add the custom post type code<\/strong>:<br>Use the <code>register_post_type()<\/code> function to define your custom post type. Below is a basic example to create a &#8220;Books&#8221; custom post type:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code><code>function create_books_post_type() {\n    $labels = array(\n        'name'               => _x('Books', 'Post Type General Name', 'textdomain'),\n        'singular_name'      => _x('Book', 'Post Type Singular Name', 'textdomain'),\n        'menu_name'          => __('Books', 'textdomain'),\n        'name_admin_bar'     => __('Book', 'textdomain'),\n        'add_new_item'       => __('Add New Book', 'textdomain'),\n        'new_item'           => __('New Book', 'textdomain'),\n        'edit_item'          => __('Edit Book', 'textdomain'),\n        'view_item'          => __('View Book', 'textdomain'),\n        'all_items'          => __('All Books', 'textdomain'),\n        'search_items'       => __('Search Books', 'textdomain'),\n        'not_found'          => __('No books found', 'textdomain'),\n        'not_found_in_trash' => __('No books found in Trash', 'textdomain'),\n    );\n\n    $args = array(\n        'labels'             => $labels,\n        'public'             => true,\n        'has_archive'        => true,\n        'rewrite'            => array('slug' => 'books'),\n        'supports'           => array('title', 'editor', 'excerpt', 'thumbnail', 'comments', 'revisions'),\n        'menu_position'      => 5,\n        'menu_icon'          => 'dashicons-book', \/\/ Dashicon for the menu item\n        'show_in_rest'       => true, \/\/ For enabling Gutenberg editor\n    );\n\n    register_post_type('books', $args);\n}\nadd_action('init', 'create_books_post_type');\n<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Explanation of Code:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Labels<\/strong>: The <code>$labels<\/code> array defines how the custom post type will be displayed in the WordPress admin interface. It sets names like &#8220;Add New Book,&#8221; &#8220;All Books,&#8221; etc.<\/li>\n\n\n\n<li><strong>Args<\/strong>: The <code>$args<\/code> array configures the post type. Here\u2019s a breakdown of the key options:\n<ul class=\"wp-block-list\">\n<li><code>public<\/code>: Determines whether the post type is public.<\/li>\n\n\n\n<li><code>has_archive<\/code>: If true, enables an archive page for this post type (e.g., <code>yoursite.com\/books<\/code>).<\/li>\n\n\n\n<li><code>rewrite<\/code>: Defines the URL slug for this post type.<\/li>\n\n\n\n<li><code>supports<\/code>: Specifies which fields (title, editor, thumbnail, etc.) the post type should support.<\/li>\n\n\n\n<li><code>menu_icon<\/code>: Specifies the icon displayed in the WordPress dashboard. You can use <a>Dashicons<\/a> for this.<\/li>\n\n\n\n<li><code>show_in_rest<\/code>: Enables Gutenberg editor support for the custom post type.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Customize the Custom Post Type Further<\/h3>\n\n\n\n<p>You can further customize your custom post type with different options, depending on your needs. Below are a few advanced configurations:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. <strong>Hierarchical Custom Post Types (Like Pages)<\/strong><\/h4>\n\n\n\n<p>If you want your custom post type to behave like pages (i.e., with parent and child posts), set <code>hierarchical<\/code> to <code>true<\/code> in the <code>$args<\/code> array:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>'hierarchical' => true,<br><\/code><\/pre>\n\n\n\n<p>This allows you to create parent-child relationships between posts.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2. <strong>Add Custom Taxonomies<\/strong><\/h4>\n\n\n\n<p>Custom taxonomies let you categorize your custom post type. For example, if you\u2019re creating a &#8220;Books&#8221; post type, you might want to categorize them by genre.<\/p>\n\n\n\n<p>Here&#8217;s how to register a custom taxonomy called &#8220;Genre&#8221; for the &#8220;Books&#8221; post type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>function create_genre_taxonomy() {\n    $labels = array(\n        'name'              => _x('Genres', 'taxonomy general name', 'textdomain'),\n        'singular_name'     => _x('Genre', 'taxonomy singular name', 'textdomain'),\n        'search_items'      => __('Search Genres', 'textdomain'),\n        'all_items'         => __('All Genres', 'textdomain'),\n        'parent_item'       => __('Parent Genre', 'textdomain'),\n        'parent_item_colon' => __('Parent Genre:', 'textdomain'),\n        'edit_item'         => __('Edit Genre', 'textdomain'),\n        'update_item'       => __('Update Genre', 'textdomain'),\n        'add_new_item'      => __('Add New Genre', 'textdomain'),\n        'new_item_name'     => __('New Genre Name', 'textdomain'),\n        'menu_name'         => __('Genres', 'textdomain'),\n    );\n\n    $args = array(\n        'hierarchical'      => true,\n        'labels'            => $labels,\n        'show_ui'           => true,\n        'show_admin_column' => true,\n        'query_var'         => true,\n        'rewrite'           => array('slug' => 'genre'),\n    );\n\n    register_taxonomy('genre', array('books'), $args);\n}\nadd_action('init', 'create_genre_taxonomy');\n<\/code><\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">3. <strong>Custom Meta Boxes<\/strong><\/h4>\n\n\n\n<p>You can add custom meta boxes to your custom post types to collect additional information. For example, if you&#8217;re working with &#8220;Books,&#8221; you might want to collect information like author, publisher, and publication year.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>function add_books_meta_boxes() {\n    add_meta_box('book_details', 'Book Details', 'book_details_callback', 'books', 'normal', 'high');\n}\n\nfunction book_details_callback($post) {\n    \/\/ Meta box HTML goes here\n    echo '&lt;label for=\"book_author\">Author:&lt;\/label>';\n    echo '&lt;input type=\"text\" id=\"book_author\" name=\"book_author\" value=\"' . get_post_meta($post->ID, 'book_author', true) . '\" \/>';\n}\nadd_action('add_meta_boxes', 'add_books_meta_boxes');\n<\/code><\/code><\/pre>\n\n\n\n<p>This creates a custom meta box in the WordPress admin for your &#8220;Books&#8221; custom post type.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Display Your Custom Post Type on the Frontend<\/h3>\n\n\n\n<p>Once you\u2019ve created your custom post type, you\u2019ll want to display it on the front end of your site.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. <strong>Create a Custom Archive Page<\/strong><\/h4>\n\n\n\n<p>To create a custom archive page for your custom post type, create a file called <code>archive-books.php<\/code> in your theme folder. This will be used to display the archive page for your custom post type.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>&lt;?php get_header(); ?>\n\n&lt;h1>Books Archive&lt;\/h1>\n\n&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?>\n    &lt;article>\n        &lt;h2>&lt;a href=\"&lt;?php the_permalink(); ?>\">&lt;?php the_title(); ?>&lt;\/a>&lt;\/h2>\n        &lt;div>&lt;?php the_excerpt(); ?>&lt;\/div>\n    &lt;\/article>\n&lt;?php endwhile; else : ?>\n    &lt;p>No books found&lt;\/p>\n&lt;?php endif; ?>\n\n&lt;?php get_footer(); ?>\n<\/code><\/code><\/pre>\n\n\n\n<p>This template will automatically display all posts of the &#8220;Books&#8221; custom post type.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2. <strong>Create a Single Post Template<\/strong><\/h4>\n\n\n\n<p>You can also create a custom template for displaying individual posts of your custom post type. Create a file called <code>single-books.php<\/code> in your theme folder:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>&lt;?php get_header(); ?>\n\n&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?>\n    &lt;article>\n        &lt;h1>&lt;?php the_title(); ?>&lt;\/h1>\n        &lt;div>&lt;?php the_content(); ?>&lt;\/div>\n    &lt;\/article>\n&lt;?php endwhile; endif; ?>\n\n&lt;?php get_footer(); ?>\n<\/code><\/code><\/pre>\n\n\n\n<p>This template will be used whenever you view a single &#8220;Book&#8221; post.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Test Your Post &#8230;<\/h3>\n","protected":false},"excerpt":{"rendered":"<p>WordPress is known for its flexibility, and one of the most powerful features of this platform is Custom Post Types (CPTs). By default, WordPress comes with built-in post types like posts, pages, and attachments, but there are times when you need to create custom content types for more specific purposes. For instance, if you\u2019re building [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":152,"comment_status":"open","ping_status":"open","sticky":false,"template":"custom-post-with-sidebar.php","format":"standard","meta":{"_acf_changed":false,"googlesitekit_rrm_CAow44u0DA:productID":"","footnotes":""},"categories":[32],"tags":[9,6],"class_list":["post-150","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-development-with-wordpress","tag-web-development","tag-wordpress-website"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Create Custom Post Types in WordPress: A Complete Guide by Itxperts - Itxperts<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create Custom Post Types in WordPress: A Complete Guide by Itxperts - Itxperts\" \/>\n<meta property=\"og:description\" content=\"WordPress is known for its flexibility, and one of the most powerful features of this platform is Custom Post Types (CPTs). By default, WordPress comes with built-in post types like posts, pages, and attachments, but there are times when you need to create custom content types for more specific purposes. For instance, if you\u2019re building [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/\" \/>\n<meta property=\"og:site_name\" content=\"Itxperts\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/itxperts.co.in\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-03T10:13:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-25T10:35:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itxperts.co.in\/blog\/wp-content\/uploads\/2024\/10\/Custom-Post-Types.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1792\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"@mritxperts\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"@mritxperts\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/\"},\"author\":{\"name\":\"@mritxperts\",\"@id\":\"https:\/\/itxperts.co.in\/blog\/#\/schema\/person\/77ad4d47f9f82583ee23e37010a52fc6\"},\"headline\":\"How to Create Custom Post Types in WordPress: A Complete Guide by Itxperts\",\"datePublished\":\"2024-10-03T10:13:04+00:00\",\"dateModified\":\"2024-10-25T10:35:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/\"},\"wordCount\":742,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/itxperts.co.in\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/itxperts.co.in\/blog\/wp-content\/uploads\/2024\/10\/Custom-Post-Types.webp\",\"keywords\":[\"web development\",\"wordpress website\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/\",\"url\":\"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/\",\"name\":\"How to Create Custom Post Types in WordPress: A Complete Guide by Itxperts - Itxperts\",\"isPartOf\":{\"@id\":\"https:\/\/itxperts.co.in\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/itxperts.co.in\/blog\/wp-content\/uploads\/2024\/10\/Custom-Post-Types.webp\",\"datePublished\":\"2024-10-03T10:13:04+00:00\",\"dateModified\":\"2024-10-25T10:35:29+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/#primaryimage\",\"url\":\"https:\/\/itxperts.co.in\/blog\/wp-content\/uploads\/2024\/10\/Custom-Post-Types.webp\",\"contentUrl\":\"https:\/\/itxperts.co.in\/blog\/wp-content\/uploads\/2024\/10\/Custom-Post-Types.webp\",\"width\":1792,\"height\":1024},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/itxperts.co.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create Custom Post Types in WordPress: A Complete Guide by Itxperts\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/itxperts.co.in\/blog\/#website\",\"url\":\"https:\/\/itxperts.co.in\/blog\/\",\"name\":\"Itxperts\",\"description\":\"Leading Website Design Company in Madhya Pradesh\",\"publisher\":{\"@id\":\"https:\/\/itxperts.co.in\/blog\/#organization\"},\"alternateName\":\"Itxperts | Website Development in Madhya Pradesh\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/itxperts.co.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/itxperts.co.in\/blog\/#organization\",\"name\":\"Itxperts\",\"alternateName\":\"Leading Website Design Company in Madhya Pradesh \u2013 Itxperts\",\"url\":\"https:\/\/itxperts.co.in\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/itxperts.co.in\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/itxperts.co.in\/blog\/wp-content\/uploads\/2025\/05\/cropped-itxperts_logo.png\",\"contentUrl\":\"https:\/\/itxperts.co.in\/blog\/wp-content\/uploads\/2025\/05\/cropped-itxperts_logo.png\",\"width\":512,\"height\":512,\"caption\":\"Itxperts\"},\"image\":{\"@id\":\"https:\/\/itxperts.co.in\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/itxperts.co.in\",\"https:\/\/www.linkedin.com\/company\/itxpertsshivpuri\/\",\"https:\/\/www.instagram.com\/itxperts.co.in\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/itxperts.co.in\/blog\/#\/schema\/person\/77ad4d47f9f82583ee23e37010a52fc6\",\"name\":\"@mritxperts\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/itxperts.co.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/702cffafd84d85872c0d42d33a9fa39140418d7c60a1311a1f8f55b005d0570b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/702cffafd84d85872c0d42d33a9fa39140418d7c60a1311a1f8f55b005d0570b?s=96&d=mm&r=g\",\"caption\":\"@mritxperts\"},\"description\":\"I am a full-stack web developer from India with over 8 years of experience in building dynamic and responsive web solutions. Specializing in both front-end and back-end development, I have a passion for creating seamless digital experiences. When I'm not coding, I enjoy sharing insights and tutorials on the latest web technologies, helping fellow developers stay ahead in the ever-evolving tech landscape.\",\"sameAs\":[\"https:\/\/itxperts.co.in\/blog\"],\"url\":\"https:\/\/itxperts.co.in\/blog\/author\/mritxpertsgmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create Custom Post Types in WordPress: A Complete Guide by Itxperts - Itxperts","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:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/","og_locale":"en_US","og_type":"article","og_title":"How to Create Custom Post Types in WordPress: A Complete Guide by Itxperts - Itxperts","og_description":"WordPress is known for its flexibility, and one of the most powerful features of this platform is Custom Post Types (CPTs). By default, WordPress comes with built-in post types like posts, pages, and attachments, but there are times when you need to create custom content types for more specific purposes. For instance, if you\u2019re building [&hellip;]","og_url":"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/","og_site_name":"Itxperts","article_publisher":"https:\/\/www.facebook.com\/itxperts.co.in","article_published_time":"2024-10-03T10:13:04+00:00","article_modified_time":"2024-10-25T10:35:29+00:00","og_image":[{"width":1792,"height":1024,"url":"https:\/\/itxperts.co.in\/blog\/wp-content\/uploads\/2024\/10\/Custom-Post-Types.webp","type":"image\/webp"}],"author":"@mritxperts","twitter_card":"summary_large_image","twitter_misc":{"Written by":"@mritxperts","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/#article","isPartOf":{"@id":"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/"},"author":{"name":"@mritxperts","@id":"https:\/\/itxperts.co.in\/blog\/#\/schema\/person\/77ad4d47f9f82583ee23e37010a52fc6"},"headline":"How to Create Custom Post Types in WordPress: A Complete Guide by Itxperts","datePublished":"2024-10-03T10:13:04+00:00","dateModified":"2024-10-25T10:35:29+00:00","mainEntityOfPage":{"@id":"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/"},"wordCount":742,"commentCount":1,"publisher":{"@id":"https:\/\/itxperts.co.in\/blog\/#organization"},"image":{"@id":"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/#primaryimage"},"thumbnailUrl":"https:\/\/itxperts.co.in\/blog\/wp-content\/uploads\/2024\/10\/Custom-Post-Types.webp","keywords":["web development","wordpress website"],"articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/","url":"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/","name":"How to Create Custom Post Types in WordPress: A Complete Guide by Itxperts - Itxperts","isPartOf":{"@id":"https:\/\/itxperts.co.in\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/#primaryimage"},"image":{"@id":"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/#primaryimage"},"thumbnailUrl":"https:\/\/itxperts.co.in\/blog\/wp-content\/uploads\/2024\/10\/Custom-Post-Types.webp","datePublished":"2024-10-03T10:13:04+00:00","dateModified":"2024-10-25T10:35:29+00:00","breadcrumb":{"@id":"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/#primaryimage","url":"https:\/\/itxperts.co.in\/blog\/wp-content\/uploads\/2024\/10\/Custom-Post-Types.webp","contentUrl":"https:\/\/itxperts.co.in\/blog\/wp-content\/uploads\/2024\/10\/Custom-Post-Types.webp","width":1792,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/itxperts.co.in\/blog\/how-to-create-custom-post-types-in-wordpress-a-complete-guide-by-itxperts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/itxperts.co.in\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Create Custom Post Types in WordPress: A Complete Guide by Itxperts"}]},{"@type":"WebSite","@id":"https:\/\/itxperts.co.in\/blog\/#website","url":"https:\/\/itxperts.co.in\/blog\/","name":"Itxperts","description":"Leading Website Design Company in Madhya Pradesh","publisher":{"@id":"https:\/\/itxperts.co.in\/blog\/#organization"},"alternateName":"Itxperts | Website Development in Madhya Pradesh","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itxperts.co.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/itxperts.co.in\/blog\/#organization","name":"Itxperts","alternateName":"Leading Website Design Company in Madhya Pradesh \u2013 Itxperts","url":"https:\/\/itxperts.co.in\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itxperts.co.in\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/itxperts.co.in\/blog\/wp-content\/uploads\/2025\/05\/cropped-itxperts_logo.png","contentUrl":"https:\/\/itxperts.co.in\/blog\/wp-content\/uploads\/2025\/05\/cropped-itxperts_logo.png","width":512,"height":512,"caption":"Itxperts"},"image":{"@id":"https:\/\/itxperts.co.in\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/itxperts.co.in","https:\/\/www.linkedin.com\/company\/itxpertsshivpuri\/","https:\/\/www.instagram.com\/itxperts.co.in\/"]},{"@type":"Person","@id":"https:\/\/itxperts.co.in\/blog\/#\/schema\/person\/77ad4d47f9f82583ee23e37010a52fc6","name":"@mritxperts","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itxperts.co.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/702cffafd84d85872c0d42d33a9fa39140418d7c60a1311a1f8f55b005d0570b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/702cffafd84d85872c0d42d33a9fa39140418d7c60a1311a1f8f55b005d0570b?s=96&d=mm&r=g","caption":"@mritxperts"},"description":"I am a full-stack web developer from India with over 8 years of experience in building dynamic and responsive web solutions. Specializing in both front-end and back-end development, I have a passion for creating seamless digital experiences. When I'm not coding, I enjoy sharing insights and tutorials on the latest web technologies, helping fellow developers stay ahead in the ever-evolving tech landscape.","sameAs":["https:\/\/itxperts.co.in\/blog"],"url":"https:\/\/itxperts.co.in\/blog\/author\/mritxpertsgmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/itxperts.co.in\/blog\/wp-json\/wp\/v2\/posts\/150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itxperts.co.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itxperts.co.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itxperts.co.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itxperts.co.in\/blog\/wp-json\/wp\/v2\/comments?post=150"}],"version-history":[{"count":1,"href":"https:\/\/itxperts.co.in\/blog\/wp-json\/wp\/v2\/posts\/150\/revisions"}],"predecessor-version":[{"id":153,"href":"https:\/\/itxperts.co.in\/blog\/wp-json\/wp\/v2\/posts\/150\/revisions\/153"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itxperts.co.in\/blog\/wp-json\/wp\/v2\/media\/152"}],"wp:attachment":[{"href":"https:\/\/itxperts.co.in\/blog\/wp-json\/wp\/v2\/media?parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itxperts.co.in\/blog\/wp-json\/wp\/v2\/categories?post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itxperts.co.in\/blog\/wp-json\/wp\/v2\/tags?post=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}