How to Upload R Markdown Directly to WordPress

R Markdown to WordPress?

Everyone knows R Markdown is great, and so is WordPress. Wouldn’t it be greater if you could write a blog post in Markdown and directly upload it on WordPress? Well, your wish has been granted. Here’s how.

Packages Needed

You will need a package called RWordPress, which you can install from Github. To install RWordPress and some other packages RWordPress depende on, refer to this blog.

Write a Blog Post

Once you have everything installed, you can write whatever you want in R Markdown.

Upload on WP

To upload your post on WordPress, first make sure you have loaded the RWordPress package.


Then connect to your WordPress with your login credentials.

options(WordPressLogin = c(user = 'password'), # your user name & password
        WordPressURL = '') # your WP url + /xmlrpc.php at the end

Finally, use a function in knitr (install/update & load it if you haven’t) to create an html code to be uploaded on WordPress.

knit2wp('Markdown_WP.Rmd', title = 'How to Upload R Markdown Directly to WordPress', publish = FALSE) # your filename and blog post title

Done! Now you can turn your R Markdown presentation directly into a WP blog post!

Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *