Timeline for Upload automatically html files
Current License: CC BY-SA 4.0
17 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 17, 2019 at 21:44 | comment | added | asv | @mrben522 Ok, thank you very much. | |
Apr 17, 2019 at 19:21 | comment | added | mrben522 | check out the WP Utility Script Runner link I posted earlier. You can write the script for that in PHP, FTP it into a utilities folder in your theme and run it with that plugin. there's an example script in the plugin files you can check out to see how it works | |
Apr 17, 2019 at 16:18 | comment | added | asv | @mrben522 Thank you, I must install the program written in php like a plugin or is there a way to create a kind of macro in wordpress? In this case where I can find a good reference to insert a plugin | |
Apr 17, 2019 at 12:30 | comment | added | mrben522 |
@asv yeah file_get_contents is how you should get the content of the files. you can use scandir() to get a list of all the files in your directory
|
|
Apr 16, 2019 at 20:29 | comment | added | asv | @mrben522 I think I will use wp_insert_post thank you. To read content of html file can I use file_get_contents ? w3schools.com/php/func_filesystem_file_get_contents.asp | |
Apr 16, 2019 at 16:08 | comment | added | mrben522 | Or, if this isn't something you're going to be reusing ever, it might be more cost effective to hire someone on fiverr for a few bucks to just manually copy pasta everything for you. | |
Apr 16, 2019 at 16:00 | comment | added | mrben522 |
Loop through all the files, grab content and add it to a new post usingwp_insert_post
|
|
Apr 16, 2019 at 15:58 | comment | added | mrben522 | You'll probably need to write a script for that, none of the no code importers are going to handle that level of complexity. I would suggest using something like WP Utility Script Runner for that | |
Apr 16, 2019 at 15:57 | comment | added | Jos |
If you are familiar with SQL, you can turn every HTML file into an INSERT statement that will insert the file into the posts table as the post_contents field, with appriopriate defaults for other fields like post_author , post_title etc.
|
|
Apr 16, 2019 at 15:25 | comment | added | asv | HTML files contain only the post content, is there a plug in? If not is it possible to write a script? I'm new in wordpress I know programming but I don't know how write code in wordpress | |
Apr 16, 2019 at 15:20 | comment | added | WebElaine | Do the HTML files contain only the post content, or do they include things like header, footer, navigation? If they're stripped down to only the HTML you would want inside the post content itself, you could write a script to open, read, and publish a post for each one, or you can look into import plugins - not sure if any exist for straight HTML, you might have to pull them into a CSV with more details such as the post title which is also required. | |
Apr 16, 2019 at 15:17 | comment | added | asv | I want to publish them as blog posts. | |
Apr 16, 2019 at 15:17 | history | edited | asv | CC BY-SA 4.0 |
added 39 characters in body
|
Apr 16, 2019 at 15:16 | comment | added | Jos | If you actually want to upload them, you should use an FTP client, if you have FTP credentials. If you want to publish them as pages or blog posts, that's another story. | |
Apr 16, 2019 at 15:15 | review | First posts | |||
Apr 16, 2019 at 17:49 | |||||
Apr 16, 2019 at 15:15 | comment | added | MikeNGarrett | Can you provide a bit more detail? For example, what are you trying to achieve with the html files? | |
Apr 16, 2019 at 15:13 | history | asked | asv | CC BY-SA 4.0 |