Seo is Dead

  • Seo is Dead
  • SEO Beginners
  • SEO Intermediate
  • SEO Advance
  • Black Hat
  • Link Building
  • Security
  • WordPress
  • Ecommerce
  • Monetize
Home » Blog » Never Use THEMES with CUSTOM POST TYPES

by seoisdead Leave a Comment

Never Use THEMES with CUSTOM POST TYPES

You should never use themes that incorporate their own Custom Post Types, because they will disappear when you change themes.

What are Custom Post Types?

By default WordPress comes with “Posts” and “Pages”. But there is a feature that allows us to create new types of content: Custom Post Types. Custom Post Types are new types of content that we can add to WordPress. For example, in my case I have: News, pages, podcasts, courses, tutorials and downloads.

themes with Custom Post Types

Custom Post Types can be added mainly in two ways:

  • Through a theme
  • Through a plugin

Let’s take a look at both approaches and see why it is a very bad idea for a theme to incorporate its own Custom Post Types.

Custom Post Type in a Theme

This method should be avoided at all costs, since all those Custom Post Types that come with a theme, will disappear when we deactivate it.
For example, when we activate the never recommended Divi, we realize that in the control panel the Custom Post Type “Projects” has appeared out of nowhere. In principle this may seem like a good thing, because you think “Oh, great, so I have everything in the theme, and I don’t need to install a plugin“, but the problem is precisely there! You must use a plugin!

Why do you have to use a plugin? Imagine for a moment that you use Divi’s Custom Post Type. Everything seems to be working great, and you’re creating content day after day, year after year. Until one day, you decide to change your theme. Sooner or later it will happen, believe me. There will be a day that for whatever reason, you will want a newer theme, more different, lighter (remember that Divi is very slow), or simply for design reasons.

Keep Reading this POST:  What Does Wordpress Do With IMAGES?

Do you know what will happen when you deactivate Divi and activate another theme? Well, all the content that was inside the Custom Post Type of the Theme will be deleted because it is property of the Theme. So if we delete the Theme, we delete everything. Obviously they have not been “deleted”, since they are still in the database, but recovering them now will be a problem, because it is not only a matter of recovering the Custom Post Types, but also all the Custom Fields that go with them. What do we do now?

This is what is called “Lock-in” effect. That is, you are “locked” in that theme. This is done by the theme developers so that you never leave them, and you are bound to their themes, without having the option to change. So where should these Custom Post Types be defined? Easy! In plugins. And if it is with a child theme much better, here we show you the differences between a parent theme and a child theme and the importance of doing it right.

We must use Custom Post Types in Plugins

Unlike themes, all the code that comes in a plugin is maintained even if we change the theme. If we add a new plugin on sidebar, portfolio, contacts, etc, the plugin will add a new Custom Post Type in our sidebar of the WordPress admin panel. If we now change theme, all this information is maintained, with their respective custom fields.

So, theme developers who want to create features such as Custom Post Types, what they should do is create a plugin independent of their theme, which complements it. There are several ways to do that.

Keep Reading this POST:  HOW to INSTALL Several PLUGINS at Once in WORDPRESS

That way we have a couple of very important advantages:

  • The user will only install the plugin if he needs the Custom Post Types. Otherwise, why have all that code there? We gain in performance and speed!
  • If the user wants to use it and one day wants to change the theme, he doesn’t lose any content, and everything continues to work correctly. We win in freedom!

In fact, even the theme developer wins, because he can be known both for his themes and his plugins. Winning strategy. But there are still many who prefer to continue with the “lock-in” techniques to force users to stay with them. That’s why in the WordPress.org theme review team we don’t accept themes in the official repository that have Custom Post Types incorporated. Because it is forbidden to put anything in a theme that will cause content loss if the theme is left. Custom Post Types with custom content types in WordPress. Some themes have it built in, but we should avoid them, because if one day we change theme, we lose everything.

If we want to incorporate a new type of content, it is advisable to do it through a plugin.

Related posts:

What happens When you CHANGE your WordPress THEME?
What Does WordPress Do With IMAGES?
Differences Between PARENT Themes and CHILD Themes
Create GRAPHICS in WORDPRESS
What are the Differences Between WordPress.org and WordPress.com?

Filed Under: Wordpress

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Blog

About

Privacity Polity

Cookie Policy

Site Map

    Copyright © 2023

    We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
    Cookie settingsACCEPT
    Manage consent

    Privacy Overview

    This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
    Necessary
    Always Enabled
    Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
    CookieDurationDescription
    cookielawinfo-checbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
    cookielawinfo-checbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
    cookielawinfo-checbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
    cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
    cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
    viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
    Functional
    Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
    Performance
    Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
    Analytics
    Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
    Advertisement
    Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
    Others
    Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
    SAVE & ACCEPT