WordPress To Sitefinity Blog Importer

WordPress to Sitefinity Importer

A lightweight Sitefinity MVC widget for importing WordPress blog posts from a WordPress XML export into an existing Sitefinity site.

Description

The project is a lightweight Sitefinity MVC widget for importing WordPress blog posts from a WordPress XML export into an existing Sitefinity site. It helps migrate post content and images with minimal setup, making it useful for one-time blog migrations and cleanup work.

This project was built for a specific migration scenario where the goal was to keep the tool simple: upload a WordPress export file, import blog content, and recreate inline images inside Sitefinity. It is intended as a practical migration utility, not a full-featured migration platform.

This version was written, run, and tested against Sitefinity 14/15.

Features

The project should be viewed as a practical migration utility that was written and tested for a real-world use case, not as a polished turnkey package.

– Imports blog post content from a WordPress XML export
– Downloads inline images from the source WordPress site and recreates them in Sitefinity libraries
– Rewrites post content to use Sitefinity image references
– Creates or reuses a Sitefinity blog named `Blog`
– Optionally links the first imported image in the post to a custom `BlogImage` field, if that field already exists

Get It

View project and clone from Github here – 
https://github.com/compkick/WordPressToSitefinityImporter

Important Assumptions

– The original WordPress site must still be online and publicly reachable for image import to work
– Export only the blog posts you want to import
– Do not use a full WordPress export that includes unrelated content types unless you are prepared to review the results
– This widget is intended for temporary use on a protected Sitefinity page during migration, then removed

Setup

1. Copy the source files into an existing Sitefinity web application, preserving the folder structure.
2. Make sure the target Sitefinity project has the required references.
3. If you want featured-image linking, create the `BlogImage` custom field for blog posts in Sitefinity:
`AdminApp > Blogs > Blog > Custom Fields`
Use a related media field for images, with one allowed image.
4. Build and deploy the Sitefinity project.
5. Add the `WordPress Import` widget to a protected page.
6. Upload a WordPress XML export and run the import.

Required Dependencies

Sitefinity Assemblies

This code is meant to live inside a Sitefinity project, not a plain ASP.NET MVC app. It relies on the standard Sitefinity assemblies already used by the host project for:

– MVC widget integration
– blog APIs
– media library APIs
– taxonomy APIs
– metadata APIs
– `App.WorkWith()` fluent helpers

If you are dropping this into an existing Sitefinity application, those references are usually already present.

HtmlAgilityPack

`HtmlAgilityPack` is used to parse and modify imported HTML content, especially for finding `` tags and updating their attributes before saving the content into Sitefinity.

Add the `HtmlAgilityPack` NuGet package to the Sitefinity solution or web application project that will compile the widget.

Widget Registration

– Controller name: `WordPressImportController`
– Toolbox title: `WordPress Import`
– Toolbox section: `Custom Widgets`
– View folder: `Mvc/Views/WordPressImport`
– Controller folder: `Mvc/Controllers/WordPressImport`
– Importer class location: `Custom/WordPressToSitefinityImporter.cs`

Import Notes

– The importer creates or reuses a Sitefinity blog named `Blog`
– Inline images are downloaded from the source WordPress site and recreated in Sitefinity
– If the `BlogImage` custom field is missing, the import still runs and simply skips featured-image relation creation
– Very large WordPress XML exports may cause the Sitefinity web request to time out, especially when many remote images must also be downloaded

If a large import times out, the simplest workaround is to split the WordPress export into smaller XML chunks and import them separately. In some environments, server timeout settings can also be increased, but that is environment-specific and does not make the process inherently more robust.

License

This project is licensed under the MIT License. You are free to use, modify, and distribute the software under the terms of the included license.

The software is provided “as is”, without warranty of any kind, and the authors are not liable for any claims, damages, or other liability arising from its use.

Attribution

This project was inspired by the earlier WordPressToSitefinity project by Tim Williamson: https://github.com/timw255/WordPressToSitefinity

The earlier version was written for Sitefinity 7.0. This version was substantially rewritten and simplified as a smaller Sitefinity MVC widget for a narrower migration workflow, and was written, run, and tested against Sitefinity 14/15.

Future Improvements

Possible future enhancements include:

– blog selection in the widget
– tag import
– options to skip tag or category import
– author import or manual author selection
– SEO and meta import
– featured image import fallback logic
– stronger content cleanup and normalization
– import summary reporting
– duplicate handling options
– better image retry and timeout handling
– log file output under `App_Data`
– safer slug generation
– basic progress tracking
– widget designer configuration options
– UI improvements

Support

Project documentation starts in the repository README.md, which covers installation, configuration and usage.

For implementation questions, issue reporting, or enhancement requests, use the GitHub issue tracker:
GitHub: https://github.com/compkick/WordPressToSitefinityImporter/issues

Also, you can use our contact form to get in touch.