Learn how these can customize your WordPress site!
- Add functionality (or replace plugins).
- Customize site content/layout.
- Speed up WordPress performance.
- Make content easier to edit/manage.
I remember not understanding what CPT’s were when I was a beginner and then later not fully respecting the power of Gutenberg. But I don’t make that mistake anymore. These options are essential if you want a super customized professionally-built site!
This post is a continuation of my posts on Custom Post Types and Gutenberg blocks. If you haven’t read them yet, please check them out below:
- What are Custom Post Types (and why do they matter?)
- Redefining WordPress content with Gutenberg
- The magic of custom Gutenberg blocks
How CPT’s and custom Gutenberg blocks are SIMILAR
They’re similar in that they allow you to customize content. Whether this means customizing the content being shown (or customizing how it’s shown) doesn’t matter. Basically, both can be used to do what 3rd-party plugins do (adding new functions to your website design and content).
What plugins can do:
- Create different content layouts – pagebuilders
- Different types of design content – sliders, pop-ups, notifications
- Different types of text content – reviews, recipes
- Different types of content organization – portfolios, directories
Sure, there are more scenarios that don’t come to mind right now but this guide is too long already!
How CPT’s and custom Gutenberg blocks are DIFFERENT
They’re different in how they’re used, and the type of customization they offer.
- Gutenberg blocks are content blocks, and used from within your content editor. Basically, any space where you can can edit content with the Gutenberg editor.
- CPT’s are related to content taxonomy. They are for creating an entirely new category of content, and usually with different page layouts and even how it’s displayed and linked to one another on the frontend.
It’s confusing when you see plugins using both approaches to creating custom content. Which isn’t wrong, btw. In most cases, only one of them is needed and using both is only necessary for the larger feature-filled plugins.
Choosing between creating a CPT or custom Gutenberg block
Choose custom Gutenberg block if…
- You want to re-use this custom content block within your existing content.
- No data needs to be calculated or aggregated from all the data in your custom Gutenberg blocks. (For example, a being used for some random visual effect vs “review” blocks that have their scores calculated out elsewhere).
- Nothing else is needed from this custom Gutenberg block except for a specialized display on frontend and easy-editing on the backend.
Choose Custom Post Type (CPT) if…
- You need entirely different page layouts.
- You need the content to be organized in a custom way.
- You need to calculate data from this content and/or want to show it in multiple places on frontend. (E.g. having reviews on different pages but also a list of popular/recent ones or average scores on your home page.)
- You want to easily edit all this custom content from one centralized area on the backend.
- You want direct links to this custom content.
So what do you do now that you know all this info? Easy, run out and replace the plugins you have and/or create new ones to give you the features you need!
Great explanations shared with me from respected Genesis developers:
- It really depends the structure of the page. Generally, I create a CPT to handle the links and if they need to display in a page that uses Gutenberg, then I use a custom block. (Walter Lopez)
- For me, it’s about how I’m going to use it. In one case where I’d originally thought I would create a CPT for the winners of an annual award, I decided to go with blocks instead because the client had no need to show any of those entries anywhere but the page they’re entered on.I eliminated a few existing CPTs (for things like file downloads) because blocks made them redundant, and there had been no archive. But with others (print newsletters, news coverage), I kept the CPTs, because I want to show those in taxonomy archives and be able ot show recent items on other pages. (Sallie Goetsch)
Leave a Reply