To be able to use goodpress to publish posts on your WordPress website, you need to perform a few setup steps. You only need to do these once, so that’s only potentially painful at setup.

You might not need to tweak syntax highlighting and math stuff if you, well, never show code or never show math equations in your posts.


From WordPress point-of-view this package is a “remote application” therefore it needs your website to use an authentication plugin. At the moment, for the sake of simplicity, this package only relies on Application Passwords.

You cannot install plugins if you use (unless you have a costly business plan there), therefore with you cannot use the REST API. There are paid services out there providing a domain name, hosting and a one-click WordPress install, for a few dollars a month, that you could use if you don’t roll your own server.

Here’s what I did to be able to use this package on my test website:

  • Installed and activated the Application Passwords plugin. Don’t forget to keep your WordPress plugins up-to-date especially because of security updates.
  • Created a new user with editor rights, not admin, and from the admin panel I created an application password for “rmarkdown” for that user. Doing this for an user with restricted access is safer.
  • In .Renviron, save username as WP_USER and application password as WP_PWD. Re-start R. Keep .Renviron safe, it contains secrets! Here’s an example of .Renviron below, the empty line at the end of the file is needed.
WP_PWD="your application password including space e.g. blabla blabla blabla blabla NOT your WordPress main password"

Syntax highlighting

For R

To get syntax highlighting for R blocks, at the moment you need to add custom CSS (once, like the plugin setup stuff).

You could edit colors that are in the CSS file.

Later I hope to make this process easier, maybe by adding inline styles.

Other languages

I haven’t explored that yet.


To be able to use math with MathJax, you’ll need to customize your theme.

From WordPress interface go to Appearance > Theme Editor. Add the lines below (that come from MathJax docs) to the <head> div of header.php, then save.

<script src=""></script>
<script id="MathJax-script" async src=""></script>

Then refer to the usage vignette.