Hello everyone,
I am happy to announce that I have solved the problem with PHP 8 by modifying some code lines of the file “html-importer.php”. If anyone needs this file you can download it here.
Of course you need to make a backup of the original file first. Greetings from Italy.
There are several problems that are introduced when the plug-in runs under PHP 8. The first one I saw was easy to fix, but then they go more challenging.
It occurs to me that the best option is to run the plug-in under PHP 7.
I’m still surprised there is not up-to-date plug-in that imports HTML files.
Great work on this plugin. It’s saving me a lot of time, but I’m having just one issue.
I’m trying to get the custom post date to work using a div in the html formatted like this:
<div id="1/4/2005">
I’ve set the Date to “Custom Field” and under the Custom field options for Date, I’m using div, id and date like the defaults, but it’s not working.
My post dates are always the published date. I’ve tried every way of formatting the date in the div that I can think of and no dice. Am I misunderstanding the use of the custom date, or am I doing something wrong?
I’m attempting to convert Weebly generated HTML to WordPress pages using this importer. I thought I had configured everything correctly, but encountered this error (note, site name obfuscated for privacy):
======================================
Fatal error: Uncaught ArgumentCountError: fopen() expects at least 2 arguments, 1 given in /homepages/xxxxxxxxxxxxxxx/htdocs/xxxxxxxxxxxxxxx/wp-content/plugins/import-html-pages/html-importer.php:286 Stack trace: #0 /homepages/xxxxxxxxxxxxxxx/htdocs/xxxxxxxxxxxxxxx/wp-content/plugins/import-html-pages/html-importer.php(286): fopen(‘/homepages/~…’) #1 /homepages/xxxxxxxxxxxxxxx/htdocs/xxxxxxxxxxxxxxx/wp-content/plugins/import-html-pages/html-importer.php(1099): HTML_Import->get_files_from_directory(‘/homepages/~…’) #2 /homepages/xxxxxxxxxxxxxxx/htdocs/xxxxxxxxxxxxxxx/wp-content/plugins/import-html-pages/html-importer.php(1129): HTML_Import->import() #3 /homepages/xxxxxxxxxxxxxxx/htdocs/xxxxxxxxxxxxxxx/wp-admin/admin.php(364): HTML_Import->dispatch() #4 {main} thrown in?/homepages/xxxxxxxxxxxxxxx/htdocs/xxxxxxxxxxxxxxx/wp-content/plugins/import-html-pages/html-importer.php?on line?286
There has been a critical error on this website. Please check your site admin email inbox for instructions.
======================================
If any forum members have some thoughts about what is happening on line 286 of the importer code, I’m fine with tuning it. I just haven’t figured out what code to adjust.
]]>I am tryimg to move a Sitesell hosted site to WordPress. I have used HTTrack to clone the site and have all the files saved. But struggling to upload into wordpress.
I have used an HTML Importer plug in but when I click import nothing happens.
Can someone possibly assist. Would be much appreciated.
Thank you
]]>Hi,
I’ve been using this plugin for a long time and it’s great. But on a site with more than 10,000 pages it has now become extremely slow to import. On the same server, if I import 500 pages into an empty site it does so in a very short time. On a site with more than 14,000 pages, the import is really too slow. What can I do to speed up the import now? Many thanks in advance.
Under the Custom Fields tab, clicking the button “Add a custom field” was not working, and generated the console error: TypeError: $(…).live is not a function.
The solution is to edit the file tabs.js (in the js directory), and change the following line:
From: $(".cloneTableRows").live('click', function(){
To:__ $(".cloneTableRows").on('click', function(){
Fatal error: Uncaught ArgumentCountError: fopen() expects at least 2 arguments, 1 given in C:\xampp\htdocs\wordpress\wp-content\plugins\import-html-pages\html-importer.php:286 Stack trace: #0 C:\xampp\htdocs\wordpress\wp-content\plugins\import-html-pages\html-importer.php(286): fopen(‘C:/xampp/htdocs…’) #1 C:\xampp\htdocs\wordpress\wp-content\plugins\import-html-pages\html-importer.php(1098): HTML_Import->get_files_from_directory(‘C:/xampp/htdocs…’) #2 C:\xampp\htdocs\wordpress\wp-content\plugins\import-html-pages\html-importer.php(1128): HTML_Import->import() #3 C:\xampp\htdocs\wordpress\wp-admin\admin.php(364): HTML_Import->dispatch() #4 {main} thrown in C:\xampp\htdocs\wordpress\wp-content\plugins\import-html-pages\html-importer.php on line 286
]]>Fatal error: Uncaught ArgumentCountError: fopen() expects at least 2 arguments, 1 given in C:\xampp\htdocs\wordpress\wp-content\plugins\import-html-pages\html-importer.php:286 Stack trace: #0 C:\xampp\htdocs\wordpress\wp-content\plugins\import-html-pages\html-importer.php(286): fopen(‘D:/KWW/themefor…’) #1 C:\xampp\htdocs\wordpress\wp-content\plugins\import-html-pages\html-importer.php(1098): HTML_Import->get_files_from_directory(‘D:/KWW/themefor…’) #2 C:\xampp\htdocs\wordpress\wp-content\plugins\import-html-pages\html-importer.php(1128): HTML_Import->import() #3 C:\xampp\htdocs\wordpress\wp-admin\admin.php(364): HTML_Import->dispatch() #4 {main} thrown in C:\xampp\htdocs\wordpress\wp-content\plugins\import-html-pages\html-importer.php on line 286
]]>Got this error trying to import an html file with images in a subfolder
Error Details
=============
An error of type E_ERROR was caused in line 610 of the file /home/username/domains/mydomain/public_html/wp-content/plugins/import-html-pages/html-importer.php. Error message: Uncaught Error: [] operator not supported for strings in /home/username/domains/mydomain/public_html/wp-content/plugins/import-html-pages/html-importer.php:610
Stack trace:
#0 /home/username/domains/mydomain/public_html/wp-content/plugins/import-html-pages/html-importer.php(291): HTML_Import->get_post(‘/home/u68914203…’, false)
#1 /home/username/domains/mydomain/public_html/wp-content/plugins/import-html-pages/html-importer.php(1098): HTML_Import->get_files_from_directory(‘/home/u68914203…’)
#2 /home/username/domains/mydomain/public_html/wp-content/plugins/import-html-pages/html-importer.php(1128): HTML_Import->import()
#3 /home/username/domains/mydomain/public_html/wp-admin/admin.php(364): HTML_Import->dispatch()
#4 {main}
thrown`
Need some help with this WordPress plugin.
I have been tasked to get an old WP website up and running. I only have a mirror of the site that was captured by HTTrack. The site does function 90% as a static html (even the contact form works). However, moving forwards, I will need a CMS to make ongoing changes.
I have been trying to make sense of this HTML Import 2 plugin. My HTML understanding is basic but I am fairly competent at moving around inside cPanel File Manager and making minor HTML code changes. As for WP dashboard, also quite new at that too.
I have read the guide as best as I could. After saving the settings and running the import, the result was:
– Importing HTML Files = All Done
– Importing Images = All Done (Go to the Media Library)
– Importing Media Files = All Done (Go to the Media Library)
– Fixing relative links…. = No posts were found with the URL_before_HTML_Import custom field. Could not search for links.
The end result, no extra content has been added to the site. The public_html folder is exactly the same i.e. just the default WP install files. What have I done wrong?
One important point to note is the “old site URL” field was left blank since the site isn’t up and running. I only have the HTTrack mirror as I mentioned. I assume it is ok to keep this field as blank?
Looks like the version I downloaded was v2.6. I am wondering if this version is tool old?
WordPress version is 5.8.2
PHP version (web server) is 7.3.32
PHP version (database server) is 5.7.23-23
I can’t confirm if php-xml is installed on Web Server but I could not find it as a PHP extension that could be installed.
Thought and suggestions would be appreciated.
]]>I badly need this plugin to work because I have hundreds and hundreds of html pages and images to convert/import to wordpress and since I’m a complete beginner I can’t figure out any other way or implement any other solution to do that apart from this plugin.
My problems / questions:
1. I imported my html pages into my WordPress site, but the internal navigation links in the imported files don’t seem to work properly in the wordpress site. There are hundreds and hundreds of html pages and even more images – probably a few thousand elements in total. So, it’s not possible to fix manually! The problem specifically I noticed is that when I click, let’s say, the “Next” button in the menu of a page (converted into wordpress from my html) – it goes to a 404 page not found. What actually happens here is that the filename of the linked page is automatically appended at the end of the previous page’s URL along with that URL’s target file name instead of replacing that file name. But if I manually edit the URL of the linked page in the new browser tab’s address bar and remove the previous page’s filename from there, it then works. For example, here is a URL : https://example.sample.com/rockart/rockart-heritage-of-mars/part23/ . If I click “Next” in this page, it then leads to this: https://example.sample.com/rockart/rockart-heritage-of-mars/part23/part24.htm . “part24.htm” is simply appended at the end of the previous URL, instead of replacing the “part23” part of it. Instead of appending, if it replaced “part23” (without adding the “htm” extension), it would have worked, and it does if I do that manually in the address bar!! Apart from the starting page, all my pages are named serially like “part23.htm”, “part24.htm” etc. It also probably means (I haven’t checked thoroughly though) that all the pages uploaded and converted successfully, just not linked correctly any longer! Let me give another example. Take the same page mentioned above (part23) again and click on “Rockart” in the “Other sections” (navbar linking to other sections of the same subdomain staging site). This leads to another 404 with this URL: https://example.sample.com/rockart/Rockart/Rockart_Heritage_Of_Mars.html . You will notice a repetition of the word “rockart” in the URL. If you remove one of them (and the html at the end of the URL), then the real page will load. It’s right here: https://example.sample.com/rockart/Rockart_Heritage_Of_Mars . One final example. Here is an erroneous 404 URL: https://example.sample.com/rockart/marsculture_main.html . This is the homepage/entrypage/main ToCpage of this sub-site. I get this when I click “Main Contents” in the navigation section of other pages. The correct URL though is: https://example.sample.com/marsculture_main/ . There is no /rockart/ in the correct URL and shouldn’t be. I don’t know or understand why these things are happening.
2. My offiline html site (in my PC) with which I am experimenting the plugin after I uploaded my files to my subdomain’s wordpress ‘staging site’ – is structured like this:
Home (actually a Table of Contents/ToC page) linked to –> 9 separate ToC pages in 9 different folders on 9 different subjects –> The second-level ToC pages are then linked to the real pages of substance, images and CSS in their respective folders’ subfolders – 1 level beneath the 2ndary ToC pages mentioned. The pages inside the subfolders are linked to all the pages serially inside the same folder, to all the ToC pages mentioned above and also to ToC pages in other folders. That’s how the navigation works in the html site and that’s how I want it to be in the WordPress site too. One example from my offline site on my desktop: “marsculture_main.html/rockart/rockart_heritage_of_mars/part23.htm”. The first segment in this path is that of the main very first ToC page, the 2nd one is of the Subject folder or directory, the 3rd one is of the 2nd-level/subject-level ToC page, and finally the 4th one is of the actual content page inside a subfolder of its parent subject folder “rockart”. There is just one folder named “rockart” here. No other file or folder has the same name. Yet, it gets repeated in the erroneous URL mentioned above.
3. One last thing. I can see in the ‘pages’ section of my wordpress dashboard that all the header parts of my wordpress pages have turned into separate independent pages too additionally. Or most likely, these are the names of the folders (subject folders / directories mentioned above) turned into separate independent pages. I don’t really understand though why or how directory names can turn into pages. There are no html pages named like this.
4. As you can see, I am really a complete novice in website building. I don’t understand a lot of things yet. I am sure it’s not a fault or defect of the plugin. I must have made a mistake in configuring or using it – and can’t figure out what that is. So, can anybody please, please help me solve it?? I would be forever grateful and indebted to you!!!
Thanks in advance for all your help!
]]>I have an HTML export from my site, but the file is 20mb, which is apparently too large for this plugin to handle. Is there a workaround / solution?
Thanks!
]]>So I am migrating one of my website from static HTML to WordPress and changing the domain name as well.
But the Static HTML is website is having around 2000+ Blog Posts with unique URLs.
While the HTML Import 2 is successfully able to import those blogs, is it possible to import them into the same URLs well? Right now, its changing the URL to that one of the new WordPress permalink structure.
For example:
Old Blog Post URL: abc.com/1234post
New Blog Post URL should also be: bcd.com/1234post
Please help, as it would help me a lot and make it easier for me to create a wildcard redirect
]]>I’m working on a temporary domain where I’ve installed WordPress and HTML Import 2. I tried to import everything from a former HTML import (almost 500 pages) and it looks like all the pages got imported, but only 9 images were imported. How do I get all images to import and also link properly to the pages where they are placed in the old html site? Thanks in advance for any help.
]]>Hopefully someone can help with this…I accidentally imported some of the WP-content files (in the plugins folder for example) so now they’re redirected to my site URL! I’m assuming this is not OK? Is it possible to undo this?! I’ve searched everywhere for help with this but can’t find! I understand it’s not possible to undo the import, but is there a way I can change the WP files that shouldn’t have been imported back to how they’re supposed to be? Maybe in the .htaccess? Thanks in advance for any help! ??
]]>On the HTML Importer pages, on clicking Submit I get the error:
Fatal error: Uncaught Error: [] operator not supported for strings in [..]\html-importer.php on line 610
This appears to be due to using PHP 7.1+ which introduced a change in syntax. The solution is to edit the html-importer.php, and add a new line before line 610.
Existing code (html-importer.php)
610: $this->table[] = "<tr><th class='error'>--</th><td colspan='3' class='error'> " . sprintf( __( "%s ( %s ) has already been imported", 'html-import-pages' ), $my_post['post_title'], $handle ) . "</td></tr>";
Edited code (html-importer.php)
610: $this->table = [];
611: $this->table[] = "<tr><th class='error'>--</th><td colspan='3' class='error'> " . sprintf( __( "%s ( %s ) has already been imported", 'html-import-pages' ), $my_post['post_title'], $handle ) . "</td></tr>";
In other words, when the new line 610 is inserted, the line that was 610 becomes lines 611.
]]>Thank you for this wonderful plug in to convert an old html website to wordpress. I have a html website which has great Google rankings and is often referenced by other websites.
What I am worried about is that if I use the plug-in HTML Import2, will I end up with new URLs for each of my pages, which means I lose all my google rankings and of course the links from other websites.
Does it mean I will then have to create redirects for every page – and my website has 300 pages!!! Any help appreciated. Thanks.
]]>Hello I have a problem,
Many times it happens to me that I copy the content of a website. I am looking for attributes and classes with inspect. But many times it is inevitable that the configuration of the page will also copy the related posts and share the post.
There is some way to identify these fields even semantically, because many of them always start with “follow us on social networks” or “related posts” and then it is a nuisance to go page by page deleting the last part that is copied because there are no more remedy??
Thank you.
]]>I’m trying to install this plugin to use for my website and I’m running wordpress 5.4.1. and nothing’s happening, can someone please help?
]]>I cannot get the program running properly.
I have downloaded an entire Drupal Website to my local computer. All pages and posts I want are ther as html-pages. Now I try to install and convert that content to my existing wordpress website with existing theme. I follow the steps of the program, but after pressing submit I get the ímport ready page’ within seconds, but nothing happens or has happened. Content is nowhere to be found. The List with ID – Old Pathe – New Path – Title is empty
What am I missing here? Hope someone can help because this would help me hugely.
Hi, this is very nice plugin but I have same problem. I can’t add tags, in tags I see this message:
You did not enter an HTML content tag to import.
My site is https://fullfreesoftware.net/
Hello, Does this plug-in work with WordPress version 4.9.10? Do you have any experience using it with this version? Can I import from NetObjects Fusion version 7 into WordPress V 4.9.10? Much thanks!
]]>Hi Stephanie-
Thank you so much for this plugin. I am wondering if it is possible only to convert files from a local server (and directory) or is it possible from a remote directory such as Box or Dropbox.
I am working with a large site and trying to preserve the original date and time, and whenever I transfer the files from either of those two cloud resources to my own server it changes the date and time. Have gone back nd forth with numerous hosts so I wanted to see if I could convert directly from dropbox or box?
Thank you so much.
]]>Brand new installation of WP v5.1 on latest WAMP server. No other plugins.
First time use of plug in.
Simple test directory with one html file and directory of images.
Notice: Undefined index: index_files in C:\wamp64\www\jowettclub\wordpress\wp-content\plugins\import-html-pages\html-import-options.php on line 801
Undefined index: title_inside in C:\wamp64\www\jowettclub\wordpress\wp-content\plugins\import-html-pages\html-import-options.php on line 871
Cannot modify header information – headers already sent by (output started at C:\wamp64\www\jowettclub\wordpress\wp-content\plugins\import-html-pages\html-import-options.php:835) in C:\wamp64\www\jowettclub\wordpress\wp-includes\pluggable.php on line 1251
Warning: Cannot modify header information – headers already sent by (output started at C:\wamp64\www\jowettclub\wordpress\wp-content\plugins\import-html-pages\html-import-options.php:835) in C:\wamp64\www\jowettclub\wordpress\wp-includes\pluggable.php on line 1254
Hi there,
Is there a chance that the imported pages from HTML Import 2 can be used in Gutenberg?
Right now, the resulting page is written to the classic editor, but appears as an html page if converted with the convert to blocks command beside the block. https://cl.ly/fb6f1f768180
Thanks for updating me…
I don’t think the plug-in does it, but it would be useful if in additional to importing custom fields using an HTML tag, that you could also specify a meta tag, eg:
<meta name=”citation_journal_title” content=”Journal name”>
<meta name=”citation_authors” content=”John Doe”>
<meta name=”citation_title” content=”Article title”>
<meta name=”citation_date” content=”09/01/1986″>
<meta name=”citation_issue” content=”12″>
Good morning
I have a problem, when I try to import an html post and the post has a number each, how can I do a massive import?
For example:
An article is: <article id = “post-1207”>
Another article is: <article id = “post-1208”>
Another article is: <article id = “post-1209”>
….
Thank you so much!!!!
]]>Good day! I use nginx 1.14 and php-fpm7
Single html page import work well, but if I try to import the html files from the folder then I get the zero result:
HTML Importer
Importing HTML files…
ID Old path New path Title
All done. Have fun!
there is an error in nginx error log:
2018/08/13 01:14:01 [error] 5167#5167: *5387 FastCGI sent in stderr: “PHP message: PHP Warning: Invalid argument supplied for foreach() in /home/astra/www/sitename/wp-content/plugins/import-html-pages/html-importer.php on line 1040” while reading upstream, client: ip, server: servername, request: “POST /wp-admin/admin.php?import=html&step=1 HTTP/1.1”, upstream: “fastcgi://unix:/run/php/php7.0-fpm.sock:”, host: “hostname”, referrer: “https://siteadress/wp-admin/admin.php?import=html”
How i can resolve this problem? THank you!
]]>I have 8000 files I need to convert. I have uploaded these into a folder. HTML Import will only do a few hundred at a time. I am okay with that. The problem is that I have converted over 5300 files so far but HTML Import has reached a dead end.
Now it will only convert one page at a time. I can go back run it again but each time I get it to select folder, it will only convert one of the files there. I have tried moving them to a new folder but I encounter the same problem. This was it looks as though I will be here until Christmas doing each page one at a time.
Any suggestions?
]]>