Turning WP blogs into HTML

Discussion Of All Legal Topics Is Fine Anything Goes. Be Respectful of Others. No Personal Information or Attacks.
All Traffic, Link, Banner, Push Notification and Advertising, Offers & Requests Here,.
Domains & Websites For Sale and Requests Here.
Keep One thread per person & No More Than 1 Weekly Bump.
antisocial
Verified Member
Verified Member
Posts: 401
Joined: November 18th, 2019, 2:05 am
Contact:

#16

Post by antisocial » August 22nd, 2026, 9:13 am

TabbyGirl wrote: ↑
August 11th, 2026, 7:28 pm
Is it a good idea, mine are being slowed by bots and it's killing me on bandwidth usage, what do you think.
How did that go and any positives from going html?




LovinLife
Verified Member
Verified Member
Posts: 205
Joined: March 20th, 2023, 3:48 pm

#17

Post by LovinLife » August 24th, 2026, 11:01 am

It makes no sense to dump WP and go html, tighten your permissions, update all plugins and be happy.




User avatar
tacnet
Board Sponsor
Board Sponsor
Posts: 3634
Joined: February 22nd, 2019, 7:21 pm
Referrals: 9
Contact:

#18

Post by tacnet » August 24th, 2026, 3:42 pm

LovinLife wrote: ↑
August 24th, 2026, 11:01 am
It makes no sense to dump WP and go html, tighten your permissions, update all plugins and be happy.
What are you talking about ???? You completely missed the point. Nobody is saying dump WP......WP IS HTML !

WP is a CMS system. Its the back end that produces your web pages. Once you start getting a lot of traffic (either via bots or just normal growth) then you need to consider producing those pages on a scheduled basis (eg every few minutes) rather than each time the page loads (which could be 1000s of times a minute). You STILL carry on using WP, you simply reduce the load it places on your servers by scheduling when it runs.

Try running native WP when your site gets over 200k hits a day

This is a standard technique that big sites use to scale up for high traffic. We've been doing it for years

User avatar
BOB777
Verified Member
Verified Member
Posts: 980
Joined: September 20th, 2018, 4:24 am

#19

Post by BOB777 » August 27th, 2026, 11:14 pm

No one has created a plugin to do this?




User avatar
tacnet
Board Sponsor
Board Sponsor
Posts: 3634
Joined: February 22nd, 2019, 7:21 pm
Referrals: 9
Contact:

#20

Post by tacnet » August 28th, 2026, 10:45 pm

Ive had a couple of questions about this so I thought I would knock up a quick step by step example of how to write your WP (or any script) pages to static HTML files using a cron job. A cron job is simply a scheduled task that you can setup to run repeatedly and as often as you like

Generally you would use this for your high traffic pages so instead of your script having to run maybe 1000s of times a minute, you can set it to run once every say 5 minutes and save the output to static html files. That massively reduces your server load
  • 1. Copy the code below and save it to a file called html_cron.php. Change the URL's and filenames as appropriate for your site. You can write as many pages as you like
  • 2. Upload it to somewhere on your server and CHMOD it to 755. You can test the script is working by opening it in your browser
  • 3. You can easily setup the cron job in c-panel. See https://www.kualo.com/knowledgebase/cpa ... -in-cpanel
    The cron command will be something like this :-

    */5 * * * * /usr/local/bin/php /home/youruser/public_html/path/to/html_cron.php >/dev/null 2>&1

    That will run the cron script every 5 minutes and update the html pages. The >/dev/null 2>&1 simply discards the output
  • Now update your .htaccess file to re-direct your script page(s) to the html file(s)

    RewriteEngine On
    RewriteRule ^path/to/my/url$ /path/to/html_file.html [NC,L]


Code: Select all

<?php 
//   Simple write URL to html cron script


function write_page($url, $filename) {
	
	$html = file_get_contents($url);
	
	if (strlen($html) > 0) {
	
			$handle = fopen($filename,"w");
			fwrite($handle,$html);
			fclose($handle);
			print "Saved <a href='$url'>$url</a> to <a href='$filename'>$filename</a><br>";
			
	}
	
	else { print "Could not read $url<br>"; }
}



// Below you can call the function as many times as you like in the format
// write_page('url_to_read', 'filename.html');
// For example :-

write_page('https://www.sponsorchat.com/', 'main_index.html');

// You can also add a relative path to the filename 
write_page('https://www.sponsorchat.com/viewforum.php?f=74', 'html_pages/topic_list.html');




?>
That's it. Hope somebody finds that useful

greatpornlinks
Verified Member
Verified Member
Posts: 1710
Joined: June 14th, 2018, 6:51 pm

#21

Post by greatpornlinks » August 31st, 2026, 6:56 am

tacnet wrote: ↑
August 11th, 2026, 10:10 pm
Its very easy to setup a cron job to read your high traffic pages and store them as static html, say every minute.

Then its simply a case of using .htaccess to redirect links to those static html files

Its a standard scaling up technique that we've been using for years


This can save me so much trouble with bots hitting php files on my blogs, I will give it a shot and report back once I get things underway.

I won't hijack your thread with my next comment, I'll start a new thread.
Never have your honey where you make your money.
~ HeidiHoe 2023

User avatar
AlexO
Verified Member
Verified Member
Posts: 6390
Joined: February 10th, 2018, 5:37 pm
Title: I like Celebrities

#22

Post by AlexO » September 2nd, 2026, 8:18 am

This is a very good idea going to try it out on one of my blogs see if it affects speed.
Give me celebrity porn :twisted:

User avatar
gotonudecom
Verified Member
Verified Member
Posts: 3168
Joined: February 6th, 2018, 1:54 pm
Title: DomainMaster
Referrals: 30
Contact:

#23

Post by gotonudecom » September 2nd, 2026, 3:23 pm

AlexO wrote: ↑
September 2nd, 2026, 8:18 am
This is a very good idea going to try it out on one of my blogs see if it affects speed.
Bikker installed a great cache plugin that greatly reduced the impact on our database.
He also set the server firewall to block hits that come in to fast from a single IP.
When the bots hit our servers, too fast, they get blocked.

Another test we did included converting the database to json files and now the HTML is created from those files. That did become an issue on the really big sites as it takes so long to update all the json files at once.
we are working on updating the json files one at a time, only when a page is created or updated. Also adding excluding any pages that need to remain dynamic.

This is not a WP responsibility to deal with. this is a server responsibility.

WP is a CMS not a server security system.

BrentG
Verified Member
Verified Member
Posts: 380
Joined: September 28th, 2019, 7:35 am

#24

Post by BrentG » September 4th, 2026, 2:07 pm

Any downside to this?




Kosta
Verified Member
Verified Member
Posts: 273
Joined: April 11th, 2023, 1:56 pm

#25

Post by Kosta » September 10th, 2026, 8:27 am

Keep auto updates on, WP is as good as it gets for a free script.




User avatar
tacnet
Board Sponsor
Board Sponsor
Posts: 3634
Joined: February 22nd, 2019, 7:21 pm
Referrals: 9
Contact:

#26

Post by tacnet » September 10th, 2026, 4:04 pm

BrentG wrote: ↑
September 4th, 2026, 2:07 pm
Any downside to this?
Nope. You can set a cron job to update your pages every minute if you like meaning WP (or whatever back end script you use) will only run a maximum of once a minute, regardless of how many hits its getting

And if you don't have c-panel, then you can use the "crontab -e" command. See https://uptimerobot.com/knowledge-hub/c ... ab-safely/

Example cron job to run every minute :-

* * * * * /usr/local/bin/php /home/youruser/public_html/path/to/html_cron.php >/dev/null 2>&1

The stars equate to minute (0-59), hour (0-23), day of month (1-31), month (1-12), day of week (0-6)

We've been doing this for years r6d10k

User avatar
gspotman
Verified Member
Verified Member
Posts: 1412
Joined: June 6th, 2018, 7:42 pm

#27

Post by gspotman » September 21st, 2026, 8:31 am

There are plugins to turn WP into a html based site, the problem is you can not add new categories and posts to the html version once you create it.
Teams: 60c094411cbb39b8
Email: gspotman@gmx.com

User avatar
tacnet
Board Sponsor
Board Sponsor
Posts: 3634
Joined: February 22nd, 2019, 7:21 pm
Referrals: 9
Contact:

#28

Post by tacnet » September 21st, 2026, 12:47 pm

gspotman wrote: ↑
September 21st, 2026, 8:31 am
There are plugins to turn WP into a html based site, the problem is you can not add new categories and posts to the html version once you create it.
I thought there might be a plugin to do this but Im surprised you cant update it ?. An html file is no different to any other file and can be updated as often as you like

Still, the solution above will work with WP and pretty much any other CMS script r6d10k

User avatar
gotonudecom
Verified Member
Verified Member
Posts: 3168
Joined: February 6th, 2018, 1:54 pm
Title: DomainMaster
Referrals: 30
Contact:

#29

Post by gotonudecom » September 23rd, 2026, 11:57 am

tacnet wrote: ↑
September 21st, 2026, 12:47 pm
gspotman wrote: ↑
September 21st, 2026, 8:31 am
There are plugins to turn WP into a html based site, the problem is you can not add new categories and posts to the html version once you create it.
I thought there might be a plugin to do this but Im surprised you cant update it ?. An html file is no different to any other file and can be updated as often as you like

Still, the solution above will work with WP and pretty much any other CMS script r6d10k
@tacnet
Have you experience or heard of exporting the WP database into json files and using python to create the static pages of the site?

User avatar
tacnet
Board Sponsor
Board Sponsor
Posts: 3634
Joined: February 22nd, 2019, 7:21 pm
Referrals: 9
Contact:

#30

Post by tacnet » September 23rd, 2026, 7:22 pm

gotonudecom wrote: ↑
September 23rd, 2026, 11:57 am
tacnet wrote: ↑
September 21st, 2026, 12:47 pm
gspotman wrote: ↑
September 21st, 2026, 8:31 am
There are plugins to turn WP into a html based site, the problem is you can not add new categories and posts to the html version once you create it.
I thought there might be a plugin to do this but Im surprised you cant update it ?. An html file is no different to any other file and can be updated as often as you like

Still, the solution above will work with WP and pretty much any other CMS script r6d10k
@tacnet
Have you experience or heard of exporting the WP database into json files and using python to create the static pages of the site?
That's one way of doing it but it seems a bit over complicated. That little script I posted above will take whatever output WP produces and write it straight to an html file. No export or json files needed

Turning WP blogs into HTML

Post Reply