When I started this site, one of my first steps was to find out how to post my Unity sample games to WordPress. It’s a simple process, but one that still took a bit to work out. Resolving this has helped me liven up some articles, such as the basics kickoff of my shader series.

There wasn’t much out there to help, and I found myself buying multiple solutions to get the right feature set. In the end, I found my favorite, so hopefully this post can shorten your journey.

If you have any questions or concerns, ping me on Twitter or comment on the forum. And if it is working, a follow on Twitter, a download of my free shader graph node, or a purchase of a recommended asset is always appreciated.

This article may contain affiliate links, mistakes, or bad puns. Please read the disclaimer for more information.

Asset Store over WordPress Plugin

For starters, there are hits in both the WordPress store for “Unity” and the Unity Asset Store for “WordPress”. The WordPress plugin search was no good. Everything there is out of date (using the webplayer not WebGL builds) or not quite functional. You could also write your own plugin, but that sounds like a lot of work.

On the Unity Asset Store front, there are a few promising options. Strangely enough, these asset store items do not generally contain anything you put in your project. They actually contain WordPress plugins (how to deal with them later). I tried several, and the best I found has a bit of a long name with “Easy WebGL WordPress Plugin with Pro Advertising System” (I’m using version 1.0.4).

Easy WebGL

This purchase was well worth it. The plugin works simply, with the right amount of customization. You can use it to embed WebGL games in posts or pages, with pain-free set up for things like loading screens.

At the core, the other plugins available in the asset store are functionally the same. You can upload a game, and embed it in a page. But that’s where the similarities end. Easy WebGL is a much more robust plugin than the competition. For one, the documentation is far better and more thorough. Secondly, interacting with the plugin itself is the sort of experience you’d expect from a professional plugin creation crew. Not to insult the other options. They work, but just aren’t polished to the degree you’re used to if you’ve spent much time in WordPress.

Features

The plugin provides a simple mechanism for uploading and exposes many options. All options can be set at a global level, and then overridden per-game as desired, all from a dedicated page on your admin console. The options I found most worth calling out are:

Easy layout control (aspect ration, alignment)

Optionally have the loading screen be a clickable ad, and/or have a clickable ad placed over the corner of your game at all times.

Full and easy control of the static art that goes with the game (loading screens, static pre-load fallback, play button, etc.)

All in all, the interface covers all the items I could think I might want to customize.

Issues

The only issue I have is the documentation. I know I just told you that the documentation was one of this plugin’s strengths. Well, being better than the competition doesn’t make you perfect. In general, it’s fairly thorough, and more involved than most asset store items, but I have two complaints. One is that it assumes a level of WordPress and Unity-WebGL-build experience I think not all its customers have. Second is that the screenshots are low rez, so it’s really hard to tell what’s actually going on (I can’t read any of the text in the screenshots).

Since the docs are my only complaint, I figured I’d give a how-to here. The docs cover the advanced scenarios, but I’ll start at the super basics.

Installing The Unity WordPress Package

What you get with the package is a simple readme, a documentation PDF, and a zip file. The zip file is a fully fledged WordPress plugin. To install that, you’ll want to go to your WordPress admin panel, go to “Plugins->Add New”, and then click the “Upload Plugin” button.

One note here is that the plugin comes with two sample games (great) but no “delete game” functionality. As stated in their docs, you need to go through your cPanel or FTP to actually find the games and remove them. If you don’t want the sample games installed, you can remove them from the zip locally before uploading (unzip, remove, re-zip).

Preparing the Build

Building for WebGL just requires that you have that module installed. If you do not, the easiest way to fix that is to install it form the Unity Hub. Do not click “Development Build” when building the game.

The result of the build will be an “index.html”, with two folders next to it. You need to take the folder that all this is in, and zip it up. The plugin will name this game after that folder, so choose your name accordingly.

Additional Content

To make things look good, there are a few static images you’ll want to create. As I mentioned above, there are many that you can set with this plugin, but for my sample below, I only made two.

“Background Image” – this is the image shown before anyone starts playing the game. By default this will also have a logo and a play button over it. I’ve disabled the logo, and kept the play button with the provided default. Ad Image – it’s not totally obvious, but this is the image shown during loading. It’s called “Ad” image because it can be a clickable ad. To make it not clickable, just blank out the “Ad Link”. By default it links back to a (missing) page on the plugin creators website.

Those are the only images I customized. I turned off the Logo Image and the “Ad Corner Image”, and stuck with the default play and full-screen buttons for now.

Uploading your game

The developers did document this part really well. Basically, you use the plugin from within your WordPress admin page. The only tip I’d add is making sure it installs in a folder you’ll be happy cluttering with games. I chose

public_html/wp-content/uploads/unity3d/games 1 public_html / wp - content / uploads / unity3d / games

A Note On Mobile

There are some limitations to when and where WebGL content can play. On desktop you should be fine across the board. On mobile, most likely things will either not work at all, or only work in “desktop mode”. If you are on mobile now, and the game below won’t load, try clicking “request desktop site” (or whatever it’s called in your mobile browser).

Unity WordPress Sample

From there, you just play! I threw a game together to post here so that you’d have a chance to see what this looks like. Just click on the circles to make them bounce…

Loading...

Do something. Make progress Have fun.