
I tried to use WordPress with GitHub Pages - mdu96
https://www.melissadu.com/i-tried-to-use-wordpress-with-github-pages-and-it-was-a-nightmare/
======
frereubu
"running WordPress locally is a nightmare... I should also caveat that I know
almost nothing about Apache, MySQL, FTP, and PHP."

Without wishing to be too snarky, this could be rewritten as "Running this
software is a nightmare if you know nothing about the technologies it is built
on." And being slightly more snarky, my response would be: well, duh.

~~~
jonwinstanley
Totally agree, running Wordpress locally needs a minimum understanding of
Apache, MySQL and PHP for sure

~~~
tmpz22
I'd add you need to know how your OS will handle the installation, IIRC Mac OS
comes with pre-installed PHP and/or Apache which uses configuration files you
might not know to look for and may conflict using the same ports etc. Its a
mess.

~~~
reaperducer
It's not a mess. It's just different from what you're used to.

Running WordPress on macOS is slightly different from running WordPress on
Ubuntu, which is different from running it on CentOS.

I maintain WordPress sites on all three. None of them are inferior to the
other for this purpose. They just have different conventions.

In fact, I've had far fewer problems running multiple WordPress installations
on macOS than I have on CentOS. But that's because I understand Apache better
than the author of this article. Pretty much the only problem comes during a
major OS upgrade when the installed backs up some of your configuration files
and replaces them with the default. But once you deal with it one or two
times, you know what to do.

------
pembrook
So, yes, Wordpress is a nightmare.

But no, static site generator plus headless CMS is not the answer, regardless
of how many comments here enthusiastically say so.

I’ve been down the static site generator rabbit hole for the past 7
years...and realized they aren’t really well suited for anything other than
tiny developer blogs that don’t ever get updated (dev writes his occasional
post in VScode)—-or, giant company marketing sites that get hooked up to
enterprise-y headless CMS products like contentful.

If you’re somewhere in between, I’m starting to think Webflow is the answer.
In fact, I’ve started moving all my side project marketing sites/blogs over to
them and couldn’t be happier.

The problem with [insert static site generator] + [insert headless CMS] is
that getting off the ground is a massive pain in the ass.

If you’re trying to set up a static site for your side project, let me give
you a preview of what your next couple of weeks will look like:

First you have to pick a SSG. There goes a day of research. Then pick the next
hot CSS framework (of course, you shouldn’t waste your time on this, but you
will). Tailwind! Sick! Then setup a build process. Then troubleshoot the
inevitable issues. Fixed. Then setup a git repo. Then hook the repo up to
Netlify. Then hook up continuous deployment. Then get the domain. Then
configure the domain to talk to Netlify. Then realize your hot new SSG doesn’t
do any SEO stuff for you. Setup xml sitemaps. Generate proper tags &
structured data. Then you have to create the actual site. Realize your CSS
framework is overkill. You’re already a week in. Optimize for breakpoints.
Cool. Almost ready. Now let’s write some content. Shit, I’m never going to
write if I have to fire up my code editor each time. Look into headless CMS
options. There goes a day of research. Pick one. Now Setup models in the CMS.
Try to figure out how to hook it into your git repo and trigger deployments to
Netlify. Realize the UI of the headless CMS you picked is clunky. Never
actually write any content. Forget how you even set everything up. Get
frustrated. You haven’t even hooked up any analytics or email signup
capability yet. Give up.

On Webflow I’ve managed to cut the previous paragraph down by about 80%.

~~~
woutr_be
95% of your list is applicable to any other project you might venture on. This
is absolutely nothing specific to static site generators. In fact, if you
started a WordPress site from scratch, you'll probably be adding a ton more
things to that list.

I run a couple of Jekyll sites, with Directus as my headless CMS, and my
experience is pretty much the same as writing posts for a Wordpress site. I
wrote the post in a simple editor, save it, and manually trigger a deployment
on Netlify. Even the deployment can be automated if I were to set up some
simple build hooks.

There are a view downsides and limitations, but nothing I can't live without.
And it actually helps me keep everything as simple as possible.

~~~
woutr_be
Can someone point out why this comment is being down voted?

------
reaperducer
Use the right tool for the work you're trying to do. WordPress is probably the
right tool for the author's problem. GitHub Pages is probably not the best
tool to use with WordPress.

A carpenter doesn't try to build a chair without understanding how both a saw
and a measuring tape work. People who want to build a chair with a saw and a
surveying rig are probably better off going to a chair store.

It seems that the author overestimated his technical abilities, and blames the
tools he chose, rather than himself for choosing those tools.

------
MichaelStubbs
I find the first mistake here to be trying to use WordPress. Maybe it's just
because I use it so much (or rather, as a developer, I'm often hired to fix
other people's mess and broken code) but it is genuinely my most hated piece
of software.

~~~
mdu96
Haha! I'd love to hear more of your reasons why.

~~~
thedanbob
Not the OP, but I’ve fought Wordpress plenty of times as well. Probably the
worst time was when I was writing a WP authentication plugin for my org. I was
reading the docs when I ran into this gem[0]:

> The semantics seem rather fuzzy. If id is a WP_User or other object, or an
> array of properties, it seems to clone it without touching the cache.
> Otherwise if id is a number it seems to try to read it possibly from the
> cache, or from the database using ->get_data_by(), which can also update the
> cache. If id is empty it reads by login name.

I realized that if even the _offical_ documentation didn’t know what Wordpress
was doing, I definitely had no hope.

[0]
[https://codex.wordpress.org/Class_Reference/WP_User](https://codex.wordpress.org/Class_Reference/WP_User)

------
godot
I think part of the problem is because you were previously used to GitHub
Pages with Jekyll, you were trying to use a new (but old) tool (Wordpress)
with GitHub Pages and it's not a great fit for it. I'm sure it's possible
somehow, but it wouldn't be straightforward. Just conceptually I'm not sure
how it would even work: GH Pages is for hosting static sites (AFAIK) and
WordPress uses a DB and dynamically writes posts. So I'm guessing you're
trying to do a setup where you locally run WP, write from the WP interface,
saves posts in your local Mysql DB, and then generate a static site (html
files output) and pushing those files into a GitHub repo?

It's a roundabout way to publish to a web site to say the least. If Jekyll has
enough issues where you need to tweak its config in Ruby every time you want
to write, you could try a different static site generator (e.g. Hugo for
golang, or Miner [1] for Svelte. Disclaimer: I worked on Miner.).

I think the product you're looking for is a static site generator + the use of
a client-only WYSIWYG markdown editor that connects to your git repo via OAuth
and lets you write on a good UI instead of plain text markdown files. The SSG
is one of above; unfortunately I don't have a recommendation or know of a
client-only WYSIWYG MD editor with git OAuth integration.

1: [https://github.com/bigicoin/miner](https://github.com/bigicoin/miner)

~~~
mdu96
Yeah you're totally right about my mistaken logic. I definitely should've
thought through the "how it would work conceptually" part more.

Thanks for recommending Miner! Checking it out right now.

------
hombre_fatal
> I started to procrastinate writing because there was always some small thing
> I wanted to fix with Jekyll first.

This is what happened to me when I thought it would be a good idea to build my
own blog software.

These days I'm a believer in using whatever setup minimizes the daylight
between wanting to write, and writing.

~~~
mdu96
Couldn't agree more. What's your setup right now?

~~~
lovehashbrowns
I have the same problems as both OP and the blogger: I want absolutely nothing
to do with the hosting of the blog itself. I just want it to be a writing
platform, a very very simple one, and nothing more.

I ended up using Hugo hosted on AWS Amplify and CodeCommit:
[https://gohugo.io/hosting-and-deployment/hosting-on-aws-
ampl...](https://gohugo.io/hosting-and-deployment/hosting-on-aws-amplify/)

This allows me to do plenty of things. There are no servers to manage, and I
write my posts with vim and use Markdown. I have a simple theme. Deployment
and testing happens automatically through Amplify.

If I really, really, absolutely must, I can dig deeper into Hugo and do
whatever I want. But if I just want to stick to the basics, I write files in
the content folder and edit the settings file the first time. That's it!

And because it's in AWS, I can use cert manager and Route53, things I already
know from work, to put my domain on it.

This was a lot easier for me than anything else. I previously used Ghost
hosted on a Digital Ocean instance, but I quickly grew tired of having to
update Ghost, dealing with node, etc. Plus having to worry about securing the
site and the instance. Patching the instance. Backups.

~~~
AnonHP
How about Hugo’s stability when upgrading? I haven’t tried it myself, but have
read many a comment (including on HN) on how even minor version upgrades end
up breaking things.

~~~
lovehashbrowns
I honestly haven't updated! Or at least, not purposely. The package in
Ubuntu's repo is at v0.68.3 which was released at the end of March. So
apparently I updated at least once. Latest version is 0.74.3.

A lot of the updates I am missing seem to be simple bug fixes.

------
barbegal
If anyone does want to convert Wordpress pages to static pages then WP2Static
seems to be the best option [https://wp2static.com](https://wp2static.com)
They even list alternative tools that are better in certain use cases
[https://wp2static.com/alternatives/](https://wp2static.com/alternatives/)

You might not be able to find it as a plugin, the author made a deliberate
decision to delist the plugin from wordpress.org
[https://staticword.press/t/removal-of-wp2static-from-
wordpre...](https://staticword.press/t/removal-of-wp2static-from-wordpress-
org/159)

~~~
wolco
This is what the author is trying to do.

------
ReverseCold
> For example, I tried and failed multiple times to add a <meta> tag to the
> head of my index.html file. This theoretically should have been a very
> simple change.

The thing “they don’t tell you” about static site generators is that you
should vendor your site theme. Don’t expect to both get upstream updates _and_
make HTML level changes.

~~~
pydry
Every month there's a new static site generator invented. Every time I check
to see if they handle this type of thing cleanly. Every time I'm disappointed.

Hell, I'd be happy with a decent theme library that actually gets tested and
regularly updated.

------
phreack
WordPress is an incredible blog editing software, which is why it's so
popular, so I get the author's intention.

It'd be amazing to have something that let's you open a desktop app, have
WordPress with all (or most of) its themes and ease and plug-ins for blogging,
deploy changes to a git repo, and from there to a host -- in a way where you
don't need to know more than how to make an account on say Github and Netlify.

Maybe there already is something like that, I'd love to know if so!

~~~
maiensch
Well it's not WordPress and you're missing out on the plugin-ecosystem (and
there aren't that many themes yet) but the closest I know that fits your
vision would be Publii [0].

[0]: [https://getpublii.com/](https://getpublii.com/)

------
prox
Wordpress is part of the LAMP stack, and there are easy tools like XAMP to get
you up and running locally. With a tutorial it should be doable. It’s probably
better if you get hosting with auto-install if you’re really averse to
tinkering.

That said I wonder why you’d need Github Pages if you’re already set up with
Wordpress...

~~~
superhuzza
>That said I wonder why you’d need Github Pages if you’re already set up with
Wordpress...

Maybe there's something I don't understand here? Wordpress.org isn't hosted,
it's just the website software itself. Hence the need for Github Pages
(although most people just use a hosting provider like Siteground).

~~~
prox
But it’s specifically made to be a blogging software, to me it just feels like
an extra step to convert your writing, unless the Github Pages ecosystem gives
you lots of benefits.

------
AnonHP
My background: I’m a technical person who can get around Unix/Linux, work with
file permissions, shell, databases, etc., comfortably. Yet, I have to agree
with the author and her observations, especially after my trials on macOS.

> Here’s what I know now: running WordPress locally is a nightmare.
> Successfully figuring it out was way harder than it should have been.

I tried XAMPP recently after a long, long time (this is on Mac). After the
initial steps of creating a database (not a problem for me), the database
users and modifying wp-config.php, I faced all the errors the author writes
about and more, and had to search online for solutions. Updating WordPress
core fails due to permission issues. Cannot install plugins or themes from the
dashboard because of permission issues. Heck, even uploading media files, like
photos for example, for a WordPress post requires permissions to be handled.
Even the location where the site is stored has to be mounted first if you’d
like to explore, modify files, etc. Don’t even get me started on the black box
that is ProFTPD to configure FTP access to the site (neither the ProFTPD site
nor the StackExchange Q&A sites were very helpful)!

All this would be forgivable if the documentation was adequate. But I found
the XAMPP site’s documentation to be really thin and sparse. One would think
that the most popular blogging engine (WordPress) would be included in the
documentation. But no, they just wash their hands of by pointing to Bitnami
for installing apps, and that didn’t work for me either.

I can understand the XAMPP team focusing only on the basics, but the project
has been around for a very long time and should cater to what most users may
be using it for.

I recall that XAMPP (and the Bitnami stack) used to be easier to work with. Or
maybe my memory of it isn’t good enough.

I also tried MAMP and gave up within minutes (forget about the free trial of
MAMP Pro and upgrading to it).

All in all, XAMPP was a total disappointment and a very frustrating
experience. I can only deeply empathize with the author who doesn’t seem to
have as much exposure to dealing with systems at a lower level as I’ve had.

Right now, I would discourage anyone from trying XAMPP and MAMP (both on Mac;
I don’t know if they’re vastly better on Windows or Linux). Just go with an
online host with a good control panel and stop wasting your time.

~~~
mjrpes
For Windows folks, now that Window 10 WSL2 has been released, running
Wordpress locally in something like Ubuntu seems like a better way to go.

I find the drawbacks to WSL2 is that (1) there's no one-click GUI that will
install Ubuntu + Wordpress; console commands are still required. It's still a
virtual container, so network/file access isn't directly accessible like you
get with XAMPP. There was an issue where webservers hosted inside WSL2 were
not available on localhost, but that looks to be resolved and should hopefully
be available to everyone soon:
[https://github.com/microsoft/WSL/issues/5298](https://github.com/microsoft/WSL/issues/5298)

You could also install Docker inside WSL2 and run a WordPress image. However,
wrapping your head around Docker poses its own challenges. Tutorials for
Docker + Windows aren't really up to speed with WSL2 and troubleshooting often
gives out-of-date advice. For instance PHPStorm Wordpress + Docker tutorials
have files mounts from Windows into the container, which gives poor
performance. However, I did have luck getting WordPress up and running on my
local machine in Docker following this guide:
[https://www.singularaspect.com/phpstorm-using-xdebug-for-
wor...](https://www.singularaspect.com/phpstorm-using-xdebug-for-wordpress-
development-in-docker/)

------
mintone
This is not a wordpress issue and I think it’s unfair to put your problems at
its door. The issues you encountered would affect you with any PHP/MySQL
application if you chose to run the setup as you have. The optimum solution
that I’ve found is Laravel Valet and SequelPro (Both free); valet is your
server and SequelPro is your GUI for MySQL. Everything should “just work”.

The problem most likely stems from the fact that Wordpress tutorials are a
very competitive space (ads) due to the widespread adoption of the platform,
but many are either (a) not very good or (b) out of date. If you follow one
that says to use xampp or similar then you will have an experience similar to
your own. If you find one that says “use docker” you will have a needlessly
complex experience. Tutorials like this should focus on the simplest way to
execute something, but are too often written by inexperienced devs or worse,
rehashed from other tutorials by marketeers looking to produce SEO friendly
content (efficacy of advice be damned).

------
sevencolors
Laravel has a great tool called Valet. Makes running multiple instances of
WordPress locally a breeze. You just point it to a folder and it creates a
local [directory_name].test. Works great for static html too

Confused why the poster wanted to use GitHub pages. Sounds like a hassle
considering hosting with Wordpress.com you point your domain too. ️

~~~
iruoy
I'd like to add that Valet is a great tool and I use it daily.

It is a Mac app though.

~~~
bar8uyr
There's a Linux port too

------
hirako2000
It takes a while to understand the wp modular system, that's why people get
paid to set it up and customise it for specific needs.

That being said, deploying WordPress takes minutes. And running it locally as
well. Docker images are available if installing hundreds of libraries isn't
your thing.

------
aheckler
As someone who works with WordPress every day, I can see both sides of the
issue here.

Could it be easier to set up and run locally? Sure. Could it be easier to
customize without knowing any code? Sure. But also, getting a dynamic CMS like
WordPress to produce static output for use on GitHub Pages is a sort of
"square peg, round hole" situation, and it's not surprising that the author
ran into some issues.

For running WordPress locally without mucking around with PHP, MySQL, and
such, what you probably want is Local [1], which installs everything you need
all in one go, and is quite user-friendly. You can spin up local sites in
minutes, install whatever plugins you want, and go to town. (If you host with
the company that makes Local, you can even deploy to live from inside the
app.)

I haven't used any of the plugins designed to make static pages from
WordPress, but my gut read is that they probably aren't going to work quite
right unless you A) really know what you're doing with WP, and B) you
understand the limitations of your chosen static code generation tool. After
all, WordPress is meant to be run in a dynamic environment with PHP, MySQL,
and a web server. Shoehorning it into some other way of working might not end
well, especially if you are new to WordPress.

Anyway, it looks like the author wound up on SiteGround, which as basic shared
hosts go is one of the better ones. :) It'll certainly be easier than running
WP locally, generating static files, and deploying those to GitHub Pages.

[1] [https://localwp.com/](https://localwp.com/)

------
withinboredom
Just to point out a caveat with the original idea: all the posts would be
stored in a local database. If something where to happen to it, it’s quite
miserable to recreate posts from scratch, even if you have the source
material. Don’t ask how I know.

PS, author, if you see this, make sure to use a child theme or custom plugin
to make code changes. Otherwise a security update (which are usually automatic
these days) will wipe out your custom changes.

------
loteck
Publii is a local CMS application that generates static sites and pushes them
to various platforms, including GH Pages.

Theme options leave something to be desired, though.

------
shiburizu
I recently started working on my own portfolio site, and I wanted to include a
blog. I considered Wordpress to be way too overkill for what I needed, plus I
wanted to write my own theme. Plenty of flat-file CMS software options exist,
which would probably be more like what the writer needs.

Many here mention Publii which perplexed me when I saw it (a desktop app
posing as a CMS which is just an SSG) but I guess the writer would actually be
the perfect target audience for that.

I recently settled on Bludit since the web admin is very quick to get writing
and still takes care of all the extra meta tags and fields without getting in
the way of the writing, which is easy enough that I've installed it for some
websites where non-tech people are using it just fine. Totally lamenting the
lack of templating language but I've been managing.

It's very odd that blog software for the layman tends to require so much setup
and flat file CMS software are approximating but not quite achieving a dead
simple setup and usage.

------
qzw
Her blog requirements sound simple enough that I wonder if she couldn’t have
just coded up a few HTML pages by hand. Or is that too 2001?

~~~
mdu96
That's essentially what it was before :)

I mostly just wanted a better writing experience and CMS. (I talk about that
in a section on the post).

~~~
clairity
if you wanted a cms and was using jekyll, why not something like
[https://forestry.io/](https://forestry.io/) ? it's git-aware, which means it
should work with github pages (i've not tried it myself, other than a cursory
look-see).

------
pacifika
I think the author has been unlucky really.

The installation documentation has good instructions on how to setup
Wordpress. We use chassis ([https://beta.chassis.io](https://beta.chassis.io))
to run And develop it locally. If you’re looking to develop your own theme or
plug-in it’s worth checking out.

That said creating static sites is not a common use case so the author is
finding out its not super easy. Prior to installation warnings are shown for
out of date plugins, so she is unfortunate to have skipped them.

Setup an author user then you don’t have to worry about the administrative
screens that might be confusing.

I’d suggest to give it another go as it’s worth being self hosted and being in
control of your own setup, if you’re interested in learning about PHP and
WordPress.

------
mozak1111
What we really need is a good static output generation built-in wordpress that
actually works and downgrades successfully. Instead, the team decided to work
on a page builder (Gutenberg) which was/is far behind Elementor and the rest.
Static generation is an absolutely essential feature in my opinion for having
the peace of mind regarding security. I tried EVERY SINGLE one of the static
generation plugins out there for a client project (avada theme/elementor/wpml)
and none of them worked. (But apparently they do work if you use the SaaS
version, not tried it myself)

So I guess Automattic will not solve it as it would hurt their wordpress.com
business and if somebody comes up with a good static generation option will
just turn into another SaaS offering.

~~~
mdu96
Can you elaborate more on why you say static generation is an essential
feature for peace of mind w.r.t. security?

~~~
mozak1111
Yes. Of course. Most of the problems with Wordpress websites are because of
bugs in programs written in PHP. When you no longer serve PHP and are just
serving a bunch of HTML/CSS files then there is nothing left to hack. (unless
you want to target the webserver [such as Apache, etc.) but 9/10 times it is
some sort of an outdated software or just some previously unknown bug in some
plugin. Less attack surface, more peace of mind.

------
johnchristopher
I don't understand how the author was able to set up a
Jekyll/github/DNS/markdown website and later hitting a roadblock with the
whole Apache/PHP/FTP/MySQL stack.

Is the root of all this the fact that github offers free hosting through
github pages ?

------
jonwinstanley
Wow this article makes me feel old. Running wordpress locally is something I
have done so many times in the past, but yes, I would not imagine it being a
good fit for then turning it into a static site.

These days there are a lot of better CMS options for JS single page
applications.

~~~
mdu96
Do you have any recs for what those better CMS options are?

------
bookofjoe
FWIW I've used Typepad for my blog since 2004. I may be the only person in the
world still using it, since it's never ever mentioned as a WordPress
alternative.

------
coldtea
> _Here’s what I know now: running WordPress locally is a nightmare.
> Successfully figuring it out was way harder than it should have been. If
> you’re trying to do this yourself, don’t. You most likely don’t need to, and
> there’s probably another solution you can use to get to what you want. (I
> should also caveat that I know almost nothing about Apache, MySQL, FTP, and
> PHP._

Running "ls" can be a nighmare too if you know nothing about filesystems,
files, file types, flags, manpages, and so on.

------
pmlnr
The built in php -S can run WP just fine, albeit without url rewrites, aka
nice permalinks. One still needs a mysql server though.

------
david_draco
Perhaps a wordpress.org instance can be wget/httrack mirrored and uploaded as
github pages.

------
richsu-ca
The TLDR is right at the end when I have already read the whole thing! :)

By the way, I recently migrated a weblog from Wordpress to Hugo on Netlifly.
It was easy! Just add a post in GitHub and it automatically triggers a build
in Netlifly and the post is live in seconds! You can also have your own custom
domain for free.

Don’t have recent experience with Jekyll but can’t imagine it being that
painful with the build/customization.

------
pluc
> "However, I really don’t think I should have needed to learn about all of
> those technologies just to set up WordPress locally"

Then you have no business being a developer

~~~
dang
Please omit personal swipes from comments on HN. In this case, since the
comment consists of nothing but a personal swipe, it would be better not to
post.

[https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html)

