Advanced Migration Topics
Advanced Migration Topics
This sample post demonstrates more advanced features and formatting options available in the template.
Custom Post Types
If your WordPress site uses custom post types, you may need to extend the migration script. The WordPressClient class can be easily extended to support additional content types.
Markdown Features
Lists
You can create ordered lists:
- First item
- Second item
- Third item
Or unordered lists:
- Item one
- Item two
- Item three
Blockquotes
This is a blockquote. Use it to highlight important information or quotes from other sources.
Tables
The template supports GitHub Flavored Markdown tables:
| Feature | WordPress | Next.js |
|---|---|---|
| Performance | Good | Excellent |
| SEO | Good | Excellent |
| Developer Experience | Moderate | Excellent |
Code Blocks in Multiple Languages
Python Example
def migrate_post(post):
"""Convert WordPress post to Markdown"""
markdown = html_to_markdown(post.content)
return markdown
SQL Example
SELECT
post_title,
post_date
FROM wp_posts
WHERE post_status = 'publish'
ORDER BY post_date DESC;
Bash Example
#!/bin/bash
# Run migration script
npm run migrate
# Build for production
npm run build
SEO Considerations
When migrating, pay attention to:
- URL Structure: The template preserves WordPress URL structure by default
- Meta Tags: All meta tags are automatically generated
- Structured Data: JSON-LD structured data is included for better SEO
- Sitemap: A dynamic sitemap is generated automatically
Redirects
If you need to set up redirects, you can use Next.js middleware or configure them in next.config.mjs:
async redirects() {
return [
{
source: '/old-url',
destination: '/new-url',
permanent: true,
},
];
}
Related Posts
Check out our getting started guide for the basics.
Conclusion
This template provides a solid foundation for migrating from WordPress to Next.js. With a bit of customization, you can handle even complex migration scenarios.