Close Menu
Infoceptor
  • Business
  • Finance
  • Technology
  • Health
  • Life
  • More
    • Auto
    • Food
    • Health
    • Home
    • Space
    • Travel

Subscribe to Updates

Get the latest creative news from FooBar about art, design and business.

What's Hot
Flywheel Logo

Flywheel review in 2023

June 8, 2023
Travel restrictions in Canada are different depending on where you're traveling from and to. Here's what you need to know before you go.

Canada: Traveling restrictions and what you need to know before you go

May 19, 2024
If you are planning a trip to Spain, there are some travel restrictions that must be taken into consideration.

Spain: Traveling restrictions and what you need to know before you go

May 19, 2024
Facebook X (Twitter) Instagram
Infoceptor
  • Business
    This guide will show you how to determine the value of your business using different business valuation methods.

    How to value you business – The ultimate guide for 2023

    May 9, 2024
    Have you ever thought of starting your own laundry service? Find out how with this easy guide.

    How to start a laundry service company in 2023

    May 5, 2024
    Learn about the best online payment solutions available to you. Check out what’s available, learn their pros and cons, and choose the one that best fits your needs.

    The 15 best online payment solutions in 2023

    April 27, 2024
    Learn how to create powerful backlinks for your website and increase your site's search engine ranking.

    How to build backlinks to your website

    April 25, 2024
    In this beginner's guide, we will show you the steps involved in creating a mobile app.

    Beginner’s guide on how to develop a mobile app

    April 24, 2024
  • Finance
    Learn how to build wealth and financial security. This article will share steps you can take to build a reliable cash reserve that will grow over time.

    Do you want to build wealth? Here are some ways to grow your money

    May 18, 2024
    Want to know your tax bracket? Check out our article for an overview of the different brackets and what you can expect to pay in 2022.

    Understanding IRS tax brackets – here’s what you’ll pay in 2023

    May 14, 2024
    This article will cover the best electric vehicle battery stocks to buy and invest in.

    The 10 best EV battery stocks to buy in 2023

    May 9, 2024
    The 10 most active penny stocks to watch this year is a list of the most active penny stocks ranked by total volume.

    The 10 most active penny stocks to watch in 2023

    May 8, 2024
    These electric car stocks are making a lot of money and you should consider adding them to your portfolio.

    The best electric car stocks to buy in 2023

    May 8, 2024
  • Technology
    Flywheel Logo

    Flywheel review in 2023

    June 8, 2023
    This article provides a list of the top iPhone models available today. Each model is reviewed based on features, specifications, performance, design and price point.

    Top iPhone models we’ve tested and you should get

    May 17, 2024
    Find out everything you need to know about the Apple Airpods Pro, including their price, features and if they're worth buying.

    Are Apple AirPods Pro a great choice in 2023?

    May 17, 2024
    To help you find the best responsive WordPress themes, we analyzed more than 100 themes and found those that are currently trending.

    The best responsive WordPress themes in 2023

    May 16, 2024
    These sympathy gifts make a great way to show you care while they also help your loved ones get through the tough times.

    The 15 best sympathy gifts that will show you care

    May 15, 2024
  • Health
  • Life
    These sympathy gifts make a great way to show you care while they also help your loved ones get through the tough times.

    The 15 best sympathy gifts that will show you care

    May 15, 2024
    Water bottles are a great way to stay hydrated. This article is dedicated to the most popular water bottles of the year!

    The best water bottles of 2023

    May 10, 2024
    Learn 30 weird and fun facts that will make you question everything.

    30 weird and fun facts that will make you question everything

    May 10, 2024
    Find out which cities in the US are the best for quality of life by checking out this article.

    20 best cities for quality of life in the USA

    May 7, 2024
    There are many ways to print your designs on t-shirts. Check out our list of the best printing services that offer top-notch quality at affordable prices.

    The 10 best T-shirt printing services of 2023

    May 6, 2024
  • More
    • Auto
    • Food
    • Health
    • Home
    • Space
    • Travel
Facebook X (Twitter) Instagram
Trending
  • Flywheel review in 2023
  • Canada: Traveling restrictions and what you need to know before you go
  • Spain: Traveling restrictions and what you need to know before you go
  • Do you want to build wealth? Here are some ways to grow your money
  • Our in-depth review of the Always Pan
  • Top iPhone models we’ve tested and you should get
  • Are Apple AirPods Pro a great choice in 2023?
  • The best shower heads of 2023
Infoceptor
Home»Technology»WordPress»How to create custom post types in WordPress
WordPress

How to create custom post types in WordPress

Matthew DrummondBy Matthew DrummondMay 13, 20246 Mins Read
Facebook Twitter LinkedIn Reddit Telegram WhatsApp Pinterest Email
Learn how to add custom post types to your WordPress website with this easy step-by-step guide.
How to create custom post types.
Share
Facebook Twitter LinkedIn

Custom post types enable you to create unique types of content for your website beyond posts and pages. They convert your WordPress blog into a robust content management system (CMS).

This article will show you how to create unique post types in WordPress.

What are custom post types?

Post types are used to differentiate between different types of content on your WordPress website. Pages and posts are both types of posts, but they fulfill specific responsibilities.

WordPress includes the following post types by default:

  • Navigation Menu
  • Page
  • Post
  • Revision
  • Attachment

Custom post types allow you to create your own post types. These are helpful when creating content that does not follow the standard post or page format.

For example, if you run a website dedicated to music album reviews, you would likely choose to create a post type for album reviews. You could also create custom post types for testimonials, portfolios, and products.

You can add different custom fields and a unique category structure to custom post types.

Numerous popular WordPress plugins utilize custom post types to store and manage data on your WordPress website.

Before adding custom post types to your WordPress website, it’s important to consider your requirements.

How to create a custom post type in WordPress

Using a plugin

Using the plugin is the simplest way of creating a custom post type in WordPress. This technique is best for beginners because it’s straightforward and simple.

The first step is to install and activate the Custom Post Type UI plugin:

Learn how to add custom post types to your WordPress website with this easy step-by-step guide.
Custom Post Type UI plugin

Head to Plugins > Add New in your WordPress dashboard, search for Custom Post Type UI plugin in the top-right search bar and click Install Now:

Learn how to add custom post types to your WordPress website with this easy step-by-step guide.
Install the plugin

Once installed, click Activate to activate the plugin:

Learn how to add custom post types to your WordPress website with this easy step-by-step guide.
Activate the plugin

After activation, you must navigate to CPT UI > Add/Edit Post Types to create a new custom post type. You need to be on the ‘Add New Post Type‘ tab to do this.

Learn how to add custom post types to your WordPress website with this easy step-by-step guide.
Head to plugin’s settings

You must first provide a slug for your custom post type, such as music. The system will use this slug in the URL and WordPress requests, so it can only be made up of letters and numbers. Then, you specify your custom post type’s plural and singular names.

Then, if you want, you can click the link that reads “Populate additional labels based on selected labels.” This will save you time by automatically populating the extra label fields below.

Learn how to add custom post types to your WordPress website with this easy step-by-step guide.
Configure plugin settings

Scroll down to the ‘Additional Labels’ section now. If you did not click the automatic feature mentioned before – you should now provide a post-type description and modify labels.

Configure additional settings
Configure additional settings

These labels will appear throughout the WordPress user interface when you’re managing content in that particular post type.

The post-type settings come next. Here, you can configure various attributes for your post type, and each option includes a brief explanation of its function.

Learn how to add custom post types to your WordPress website with this easy step-by-step guide.
Configure post type settings

For example, you can decide not to make a post type hierarchical like pages or sort posts in reverse order of when they were written.

Below the general settings, you can choose which editing features this post type will support. Tick off the options you want to include.

Learn how to add custom post types to your WordPress website with this easy step-by-step guide.
Configure editing features

To save and create your custom post type, click the Add Post Type button.

That’s it!

Creating a custom post type manually

If you ever deactivate your custom post types plugin, custom post types are lost, and your custom post type will become unregistered and inaccessible from the administration panel. This is why you might want to add your custom post type manually.

If you are working on a client’s site and do not want to install another plugin, you can manually create a custom post type by adding the code to your WordPress theme’s functions.php file or a site-specific plugin.

Here’s an easy code example:

// Our custom post type function

function create_posttype() {

    register_post_type( 'music',

    // CPT Options

        array(

            'labels' => array(

                'name' => __( 'Music' ),

                'singular_name' => __( 'Music' )

            ),

            'public' => true,

            'has_archive' => true,

            'rewrite' => array('slug' => 'music'),

            'show_in_rest' => true,

        )

    );

}

// Hooking up our function to theme setup

add_action( 'init', 'create_posttype' );

This code fragment registers the post-type music with an array of arguments. These are the options for our custom post type.

The array consists of two elements. The initial portion is labeled and is itself an array. The second section includes arguments such as public visibility, has archive, slug, and show in rest, which enable block editor support.

For a more detailed explanation, check WordPress’ official documentation.

How to display your custom post type on your WordPress website

WordPress includes support for displaying custom post types by default. Once you have added a few posts to your custom-made post type, it is time to show them on your website.

Navigate to Appearance > Menus to add a custom link to your menu. This is the link to your custom post type.

Learn how to add custom post types to your WordPress website with this easy step-by-step guide.
Displaying your custom post type

Your custom post type’s URL will most likely look like this if you are using SEO friendly permalinks:

https://example.com/music

If you are not using SEO-friendly permalinks, your custom post type URL will appear as follows:

https://example.com/?post type=music

Replace ‘example.com’ with your web domain and music with the name of your custom post type.

Visit the homepage of your website after saving the menu. When you click the newly added menu item, the archive page for your custom post type will be displayed using the archive.php template file from your theme.

People also viewed:

How to clone WordPress pages and posts What is the 500 Internal Server Error and how to fix it on WordPress How to set up reCAPTCHA on the Contact Form 7 plugin Best photo gallery plugins for your WordPress website For beginners: What is WordPress?
custom post type custom post type in WordPress get custom post type in WordPress how to display custom post type in WordPress WordPress custom post type
Share. Facebook Twitter LinkedIn Reddit Telegram WhatsApp Pinterest Email
Previous ArticleThe best hair loss treatment for men
Next Article How to prevent Apple AirTags from stalking you
Matthew Drummond

Matthew is a Infoceptor Technology writer. Having worked as a systems administrator for over 15 years gives him unique insight into the inner works of technology. Ultimately his passion for writing brought him to share his technical expertise with the world.

Related Stories

How to clone WordPress pages and posts

February 17, 2024

How to set up reCAPTCHA on the Contact Form 7 plugin

February 9, 2024

What is the 500 Internal Server Error and how to fix it on WordPress

December 31, 2023

Best photo gallery plugins for your WordPress website

October 5, 2023

Comments are closed.

Connect
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
  • LinkedIn
  • Reddit
  • TikTok
Don't Miss
Flywheel Logo Reviews

Flywheel review in 2023

By Matthew Drummond

Flywheel is a fast-growing web host that offers high-performance WordPress hosting for agencies, designers, and developers.

Travel restrictions in Canada are different depending on where you're traveling from and to. Here's what you need to know before you go.

Canada: Traveling restrictions and what you need to know before you go

May 19, 2024
If you are planning a trip to Spain, there are some travel restrictions that must be taken into consideration.

Spain: Traveling restrictions and what you need to know before you go

May 19, 2024
Learn how to build wealth and financial security. This article will share steps you can take to build a reliable cash reserve that will grow over time.

Do you want to build wealth? Here are some ways to grow your money

May 18, 2024
  • Auto
    • Auto Reviews
    • Electric
    • Insurance
  • Business
    • Company
    • Government
  • Entertainment
    • Movies
    • Music
  • Finance
    • Credit Cards
    • Crypto
    • Market
    • Personal Finance
  • Food
    • Coffee
    • Drinks
    • Holidays
  • Health
  • Beauty
  • Fitness
  • Food
  • Medical
  • Home
  • Backyard
  • Bathroom
  • Bedroom
  • Cleaning
  • Furniture
  • Home Office
  • Kitchen
  • Life
  • Astrology
  • Family
  • Fashion
  • Outdoors
  • Personal
  • Pets
  • Apple
  • Audio
  • Domain Names
  • Gaming
  • Google
  • Power
  • Reviews
  • Samsung
  • Destinations
  • Gear
  • Services
  • Space
  • Tourism
  • Technology
  • Tutorials
  • Web Hosting
  • WiFi
  • WordPress
  • Travel
  • Shopping
  • Sports
  • Work
  • Stocks
  • Television
  • Web Hosting
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn Reddit TikTok
© 2025 Infoceptor

Type above and press Enter to search. Press Esc to cancel.