admin管理员组文章数量:1429729
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.
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.
1 Answer
Reset to default 1To 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.
本文标签: Migration in new CustomPostTypeStructure
版权声明:本文标题:Migration in new Custom-Post-Type-Structure 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745552783a2663020.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论