• Skip to primary navigation
  • Skip to main content
  • Skip to footer
  • Books
    • Content Strategy for WordPress (2015)
    • WordPress for Web Developers (2013)
    • Beginning WordPress 3 (2010)
  • Blog
    • Content Modeling for WordPress
    • WordPress Hidden Gems
    • Web Design
  • Work
    • Presentations and Interviews
    • on GitHub →
    • MLIS Class Projects (2019-2022)
    • Portfolio (2002-2019)
    • WordPress Plugins

Stephanie Leary

Writer, Front End Developer, former WordPress consultant

  • About
    • Press Kit
    • Presentations and Interviews
  • Contact Me

New WordPress plugin: Import HTML Pages

July 31, 2009 Stephanie Leary 9 Comments

This plugin will import a directory of files as either pages or posts, according to configurable settings. You may specify the HTML tag containing the content you want to import (e.g. <body>, <div id=”content”> or <td width=”732″>) or the name of a Dreamweaver template region (e.g. “Main Content”).

If importing pages, the directory hierarchy will be preserved. Directories containing the specified file types will be imported as empty parent pages. Directories that do not contain the specified file types will be ignored.

As files are imported, the resulting IDs, permalinks, and titles will be displayed. On completion, the importer will provide a list of Apache redirects that can be used in your .htaccess file to seamlessly transfer visitors from the old file locations to the new WordPress posts or pages.

Options:

  • import pages or posts
  • specify content and title as HTML tags or Dreamweaver template regions
  • remove a common phrase (such as the site name) from imported titles
  • specify file extensions to import (e.g. html, htm, php)
  • specify directories to exclude (e.g. images, css)
  • if importing pages, specify whether your top-level files should become top-level pages or children of an existing page
  • choose status, author, and timestamp
  • use meta descriptions as excerpts

Requires PHP 5.

More screenshots and download info

This plugin is part of the WordPress plugin competition. Like it? Give it a rating!

Results: imported pages and rewrite rules
Results: imported pages and rewrite rules

Blogging, Web Design, WordPress

This is an excerpt from Content Strategy for WordPress.My latest books are Content Strategy for WordPress (2015) and WordPress for Web Developers (2013). Sign up to be notified when I have a new book for you.

Reader Interactions

Comments

  1. Ozh says

    August 1, 2009 at 5:35 am

    Going to give it a try, I just might need a plugin to do this in the next weeks.

    On another topic: why don’t you categorise/tag your posts under “WordPress”?

    Reply
  2. Stephanie says

    August 1, 2009 at 9:52 am

    Thanks, Ozh. Let me know whether the import times out on you — I put in a workaround for that at the last minute, but it apparently doesn’t work on all servers. I think I’m going to have to save things in a session variable so you can pick up where you left off.

    You know, I don’t know why I’ve never created a WordPress category. I never really expected to write plugins for it, not being much of a programmer. It was just this week that I realized I have EIGHT now, three in the last month. I guess it’s time to add the category!

    Reply
  3. Christopher says

    August 7, 2009 at 8:25 am

    I wish your plugin existed a year and a half ago when I switched from html to wordpress. Fortunately I think I still have a few files I never manually entered to test this with. :-)

    Reply
    • Stephanie says

      August 7, 2009 at 10:56 am

      Believe me, I wish I’d written it a year and a half ago! Let me know how it goes.

      Reply
  4. Jason says

    October 10, 2009 at 11:58 am

    I’m trying to get this to work but keep getting errors for the source files (the path to html files)… I have them in a folder called ‘text’ in the wp-content/plugins/ folder, should they be somewhere else?

    I’ve tried calling them with the full path public_html/user/wordpress/wp-content/plugins/text/ as well as every other variation… any suggestions?

    This’ll be a great plugin if I can get it to work as you describe. Thanks.

    Reply
    • Leanne says

      October 4, 2010 at 11:36 am

      Im having same problem James, did you get this fixed? If so, can you let me know the file path you used that worked?

      Thanks

      Leanne.

      Reply
  5. Bryce Wisekal says

    March 22, 2010 at 12:15 am

    Does anyone else have reviews on this plugin since last? Would love to know if this would work on importing a very large html website into a WordPress blog? The HTML website right now is in the format of a WordPress blog but isn’t running on any CMS just straight static html.

    From what I understand I can define specific tags within the html pages to pull into the posts but will it keep the proper formatting or will I be required to go through all 1500+ posts?

    Thanks for any feedback and suggestions. Kind regards!

    Reply
  6. Simon says

    May 14, 2010 at 11:27 am

    Hi trying out wordpress for 1st time. Got an old html site. Trying to use your import html plugin.

    I am using on a localhost. Have tried numerous types of paths to files and keep getting;

    Warning: scandir(Macintosh HD/Applications/XAMPP/htdocs/wordpress/wp-content/plugins/import-html-pages/oldidmu) [function.scandir]: failed to open dir: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/plugins/import-html-pages/html-import.php on line 554

    Warning: scandir() [function.scandir]: (errno 2): No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/plugins/import-html-pages/html-import.php on line 554

    Warning: Invalid argument supplied for foreach() in /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/plugins/import-html-pages/html-import.php on line 555

    Any ideas?

    regards

    Reply
  7. andy says

    March 10, 2011 at 2:09 pm

    Hi Stephanie,

    I’m trying to import a number of pages in chinese but they are not importing the original chinsese characters.

    Are there any tips / tricks for this please.

    e.g.

    Is there a setting I need to change on wordpress to enable the chinese character.

    e.g. a page that has these characters

    主辦單位: 中華民國單車安全協會(BSA)
    承辦單位: KHS 單車學校
    主旨: BSA 會員,上下坡實地操練。

    comes out as this

    5/9(?) BSA SLD ??/??/??/ ??? (?BSA????)

    ????: ??????????(BSA)
    ????: KHS ????
    ??: BSA ???????????

    I’ll leave a donation if you can help me please!!

    Many thanks!

    Reply

Leave a Reply Cancel reply

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

Footer

My Books

I’m a front end developer at Equinox OLI, working on open source library software. I was previously a freelance WordPress developer in higher education. You can get in touch here or on LinkedIn.

Copyright © 2025 Stephanie Leary · Contact