Bulk Publish / Delete Pages

James
Community Champion
41
24445

Synopsis

This Google Sheet will allow teachers to bulk publish, unpublish, or delete their wiki pages from a single spreadsheet page.

Canvas has created their own solution to bulk deleting pages that will be available in the August 15, 2020, release. More information is available in the Canvas Release Notes (2020-08-15) 

Introduction

There have been a couple of feature requests to allow for bulk deletion of courses:

  • (Sep-Dec 2015, ended with 21 votes)
  •   (Jan - Apr 2016, currently open for voting)

The main complaint behind these requests is that you have to pull up the list of pages, click on the admin cog and choose Delete, then confirm that you want to Delete the page. That takes three clicks for each page not counting the time you have to wait for the page to be deleted. To a lesser extent, there was once a need to publish/unpublish courses, but that has been nicely rolled into the interface. You just need to click once per page to publish or unpublish.

Although this isn't a very popular idea and won't save a lot of time if you only have a few pages, it's not a terribly bad idea, either, and may benefit someone who needs to delete lots of pages.

One of the things I like to do is write code that regular users can use while they wait on features to be implemented; I call them Canvancements. I've been writing a bunch of Google Sheet applications for Canvas recently, and so when I was the message come through my Inbox today, I thought it wouldn't take long, as it was essentially the same process I was using with the manage all due dates from a single spreadsheet that I wrote back in August and updated January 9, 2016.

Instructions

One Time Setup

  1. Log into your Google Drive account.
  2. Open the Page Manager spreadsheet.
  3. Choose File > Make a copy. This won't be available if you're not logged into Google Drive.
  4. There will be a Canvas menu added to the Google Sheet and you'll use it for everything else. From that menu, choose Configure API settings. You'll need to authorize Google to access your Canvas instance and tell it what your instance and access token are.

Those are things that need done before you can use the spreadsheet.


Regular Use

  1. Choose Select Course from the Canvas menu in your Google spreadsheet. Enter the Canvas Course ID as a number or you may also just paste a URL from your course.
  2. Choose Load Page List from the Canvas menu. This will load a list of the page titles and URLs and display it along with their current published state (1: published, 0: unpublished).
  3. Edit the Action column for the pages you want to change. You don't need to do anything with the pages you don't want changed.
    • Use a 1 to publish a page
    • Use a 0 to unpublish a page
    • Use a -1 to delete a page
  4. Choose Save Changes from the Canvas menu to write the changes to Canvas.

The next time you need to use this, just choose a new course and start from there.


Video Walk-Through

I consider this one of the simpler interfaces to explain, so I made a video for you. If that sounds backwards, realize it's about time management -- simpler means it takes less time to explain and edit.

Notes

  • The need to publish or unpublish may not be as great, but I it was easy to do and worked out well with the design so I included it. Besides, some people may want to delete all unpublished pages, so it serves as an easy way to identify those pages (hint, do a sort by action to group them and make them easier to change).
  • The video only shows changing two pages for demonstration purposes, but you can change as many as you need to change.
  • Do not move the columns around or delete them. I wasn't as flexible with this one as I was with the due dates spreadsheet. This one assumes you have an action, followed by a title, followed by the URL.
  • You may delete rows if you like as it does not affect the process. To be clear, you do not delete a row from the spreadsheet to delete it from Canvas, you put a -1 (negative one) in the action column to delete a page.
  • My spreadsheet apps have come a long way since I first started writing them. Everything is now controlled through a Canvas menu that is added to the Google Sheets menu. You can copy/paste your information there and Google will save it for you. You don't have to worry about sharing the document with someone because the credentials you don't go with it. When specifying Canvas IDs, you can paste an appropriate URL and it will grab the information for you. There's no longer a need to edit the source code like my first scripts required. Finally, some errors are now logged to a pop-up alert box so that you don't have to go into the source code and view the log files when things don't go as planned.
41 Comments