Using TinyMCE outside of WordPress

Recently we had to setup a TinyMCE WYSIWYG outside of WordPress so we couldn’t use the wp_editor function.

TinyMCE has changed a lot since I last used it as a stand alone feature so I wanted to make a post about how to set this up so I don’t have to look around for this info again.

Step number one is setting up the script, like so

Unfortunately you do need to setup an account and get an API key in order to correctly use TinyMCE. You also need to setup the domains you want this script to work on, this is done in your TinyMCE account.

Once we have that in place we can setup our WYSIWYG!

And there we go! That is all you need to get a basic TinyMCE instance going.

NOTE: I had to make sure I had the editor.on(‘change’) function working or else my textarea wasn’t updating quite right. You might not need this for your use case.

TinyMCE also offers additional plugins which are really neat, unfortunately they require paying a monthly subscription 🙁

If you are using TinyMCE in multiple places and NEED those plugins, it would definitely be worth it, but the default functionality is probably good enough for most users.