0


I have a question I'm not getting anywhere on. Maybe you have an idea how I can solve my problem.

Initial situation:
We currently have a blog with a lot of posts (150 posts, 7 categories and several keywords) and pictures. We want to migrate this blog and use a new theme that we want to develop ourselves. In this new theme, we would like to use Custom Post Types to better differentiate the posts. The contributions will then be written and published in the corresponding Custom Post Type areas.

Question:
How can I migrate our current blog with all the posts and categories into the new structure? What do I have to do so that the links to the already published contributions do not change and the corresponding contributions are assigned to the respective Custom Post Type areas.

0

To migrate your posts, you have a few options. The no-coding way would be to copy and paste the old Post content into CPT content one by one. Or, you could search for plugins to import content - you may or may not find one that will work. Finally, you could create your own PHP script to change the post types and assign categories. (You'll need to think about whether each category maps to a separate CPT, or if you want to have one CPT and assign WP Core's Category taxonomy, or whether you may want to use your own custom taxonomies.)

As far as links, it depends on what permalink structure you're using, but it's very unlikely that you'll be able to keep the same exact URLs. Instead, you'll want to map out all the old URLs (if you have a sitemap plugin this makes it quicker to copy and paste) and then determine what each one's new URL will be, which will depend both on your permalink structure and what CPTs and taxonomies you use. You can then use your .htaccess file to permanently redirect each old post to its corresponding new post, and if you've decided all Posts in a particular Category will map to a new CPT for example, you can set up a RedirectMatch to capture all those posts with a single rule rather than having to redirect each one individually.

However, you may want to explore why you are creating all these CPTs. It is possible using regular old Posts and Categories to style things differently everywhere, so if it's purely for styling, you may want to just work on the theme and not deal with migrating so many Posts. It's usually not advisable from an SEO standpoint to move so much content - it may also confuse longtime users of your website.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.