The googlesites package is the R implementation of the Google Sites API. Using this package assumes you’ve used the Web UI to create your site. Once you’ve got a site (and maybe some templates), you can use this package to add more content, add attachments, find content, and delete content. This package allows you to store HTML pages and other static content locally and under version control and push it to your site programmatically whenever you feel like it.

See my blog post on why Google Sites aren’t such a bad thing: Google Sites for Documentation

GitHub - googlesites View source code on GitHub at:

Quickstart Guide

First, you’ll need to install this package from GitHub.


Second, you’ll need to go through a process of authenticating with Google and specifying the domain and site name so you don’t have to refer to it explicitly each time you call a function.

options(googlesites.site_domain = "site") # or your Apps domain
options(googlesites.site_name = "my-site")

options(googleAuthR.scopes.selected = "")

Third, do stuff to your site! After you’ve loaded and configured that package, you can take advantage of all the functionality of this package to manage your site. Like this:

Add a page from HTML

test_html <- system.file("extdata", "example-site", "test.html", package="googlesites")
add_html_page(page_xhtml_source = test_html,
              page_title = 'API Test',
              page_custom_url = 'api-test',

Find your Content

find_content(value_to_match='API Test', 

Upload an Attachment to your Page

pdf_cheatsheet <- ''
download.file(pdf_cheatsheet, 'rmarkdown-cheatsheet-2.0.pdf', mode="wb")

upload_file_to_site(local_file_path = "rmarkdown-cheatsheet-2,0.pdf",
                    parent_page_id = find_content(value_to_match='API Test', 

Delete your Page

delete_content(id = find_content(value_to_match='API Test',

Additional Features

This package currently supports the bare minimum for maintaining and uploading content to a Google Site. It’s anticipated that other functions to list sites, create sites, update site categories, and manage user permissions will be created and added to this package in the future to expand its capabilities. Thank you for using.


If you have further questions please submit them via email or issue on GitHub at I’m happy to answer questions, but please do not ask questions with code in Disqus comments. Thank you!


This project was made with love and coffee. Studies show that I write R code 3x faster after drinking one cup coffee and that productivity scales linearly. Imagine what I could accomplish if you bought me 10 cups of coffee…

Thank you for your support!