diff --git a/build/index.php b/build/index.php
index 2e47aea..6695f5e 100644
--- a/build/index.php
+++ b/build/index.php
@@ -2453,7 +2453,7 @@ function render_sidebar($pageindex, $root_pagename = "")
 			continue;
 
 		// If the page already appears on the sidebar, skip it
-		if(preg_match("/>" . preg_quote($pagename) . "<\a>/m", $result) === 1)
+		if(preg_match("/>$pagename<\a>/m", $result) === 1)
 			continue;		
 		
 		// If the part of the current pagename that comes after the root
@@ -4336,7 +4336,7 @@ register_module([
 			
 			if(!in_array($format, $allowed_formats)) {
 				http_response_code(400);
-				exit(page_renderer::render_main("Format error - $settings->sitename", "<p>Error: The format '$format' is not currently supported by $settings->sitename. Supported formats: " . implode(", ", $allowed_formats) . "."));
+				exit(page_renderer::render_main("Format error - $settings->sitename", "<p>Error: The format '$format' is not currently supported by this action on $settings->sitename. Supported formats: " . implode(", ", $allowed_formats) . "."));
 			}
 			
 			$stats = stats_load();
@@ -6547,14 +6547,34 @@ register_module([
 		add_action("list", function() {
 			global $pageindex, $settings;
 			
-			$title = "All Pages";
-			$content = "	<h1>$title on $settings->sitename</h1>";
+			$supported_formats = [ "html", "json", "text" ];
+			$format = $_GET["format"] ?? "html";
 			
 			$sorted_pageindex = get_object_vars($pageindex);
 			ksort($sorted_pageindex, SORT_NATURAL);
 			
-			$content .= generate_page_list(array_keys($sorted_pageindex));
-			exit(page_renderer::render_main("$title - $settings->sitename", $content));
+			switch($format) {
+				case "html":
+					$title = "All Pages";
+					$content = "	<h1>$title on $settings->sitename</h1>";
+					
+					$content .= generate_page_list(array_keys($sorted_pageindex));
+					exit(page_renderer::render_main("$title - $settings->sitename", $content));
+					break;
+					
+				case "json":
+					header("content-type: application/json");
+					exit(json_encode(array_keys($sorted_pageindex), JSON_PRETTY_PRINT));
+				
+				case "text":
+					header("content-type: text/plain");
+					exit(implode("\n", array_keys($sorted_pageindex)));
+				
+				default:
+					http_response_code(400);
+					exit(page_renderer::render_main("Format error - $settings->sitename", "<p>Error: The format '$format' is not currently supported by this action on $settings->sitename. Supported formats: " . implode(", ", $supported_formats) . "."));
+			}
+			
 		});
 		
 		/**
@@ -6583,7 +6603,7 @@ register_module([
 			
 			if(!in_array($format, $supported_formats)) {
 				http_response_code(400);
-				exit(page_renderer::render_main("Format error - $settings->sitename", "<p>Error: The format '$format' is not currently supported by $settings->sitename. Supported formats: " . implode(", ", $supported_formats) . "."));
+				exit(page_renderer::render_main("Format error - $settings->sitename", "<p>Error: The format '$format' is not currently supported by this action on $settings->sitename. Supported formats: " . implode(", ", $supported_formats) . "."));
 			}
 			
 			if(!isset($_GET["tag"]))
diff --git a/module_index.json b/module_index.json
index 7f0f14f..57e637d 100755
--- a/module_index.json
+++ b/module_index.json
@@ -50,7 +50,7 @@
         "author": "Starbeamrainbowlabs",
         "description": "Adds a sidebar to the left hand side of every page. Add '$settings->sidebar_show = true;' to your configuration, or append '&sidebar=yes' to the url to enable. Adding to the url sets a cookie to remember your setting.",
         "id": "extra-sidebar",
-        "lastupdate": 1505768459,
+        "lastupdate": 1505768813,
         "optional": false
     },
     {
@@ -113,7 +113,7 @@
         "author": "Starbeamrainbowlabs",
         "description": "An extensible statistics calculation system. Comes with a range of built-in statistics, but can be extended by other modules too.",
         "id": "feature-stats",
-        "lastupdate": 1505579288,
+        "lastupdate": 1505768903,
         "optional": false
     },
     {
@@ -194,7 +194,7 @@
         "author": "Starbeamrainbowlabs",
         "description": "Adds a page that lists all the pages in the index along with their metadata.",
         "id": "page-list",
-        "lastupdate": 1505768745,
+        "lastupdate": 1505769039,
         "optional": false
     },
     {
diff --git a/modules/feature-stats.php b/modules/feature-stats.php
index cd65c8f..f30c437 100644
--- a/modules/feature-stats.php
+++ b/modules/feature-stats.php
@@ -33,7 +33,7 @@ register_module([
 			
 			if(!in_array($format, $allowed_formats)) {
 				http_response_code(400);
-				exit(page_renderer::render_main("Format error - $settings->sitename", "<p>Error: The format '$format' is not currently supported by $settings->sitename. Supported formats: " . implode(", ", $allowed_formats) . "."));
+				exit(page_renderer::render_main("Format error - $settings->sitename", "<p>Error: The format '$format' is not currently supported by this action on $settings->sitename. Supported formats: " . implode(", ", $allowed_formats) . "."));
 			}
 			
 			$stats = stats_load();
diff --git a/modules/page-list.php b/modules/page-list.php
index 98f74e4..1ddab54 100644
--- a/modules/page-list.php
+++ b/modules/page-list.php
@@ -26,14 +26,34 @@ register_module([
 		add_action("list", function() {
 			global $pageindex, $settings;
 			
-			$title = "All Pages";
-			$content = "	<h1>$title on $settings->sitename</h1>";
+			$supported_formats = [ "html", "json", "text" ];
+			$format = $_GET["format"] ?? "html";
 			
 			$sorted_pageindex = get_object_vars($pageindex);
 			ksort($sorted_pageindex, SORT_NATURAL);
 			
-			$content .= generate_page_list(array_keys($sorted_pageindex));
-			exit(page_renderer::render_main("$title - $settings->sitename", $content));
+			switch($format) {
+				case "html":
+					$title = "All Pages";
+					$content = "	<h1>$title on $settings->sitename</h1>";
+					
+					$content .= generate_page_list(array_keys($sorted_pageindex));
+					exit(page_renderer::render_main("$title - $settings->sitename", $content));
+					break;
+					
+				case "json":
+					header("content-type: application/json");
+					exit(json_encode(array_keys($sorted_pageindex), JSON_PRETTY_PRINT));
+				
+				case "text":
+					header("content-type: text/plain");
+					exit(implode("\n", array_keys($sorted_pageindex)));
+				
+				default:
+					http_response_code(400);
+					exit(page_renderer::render_main("Format error - $settings->sitename", "<p>Error: The format '$format' is not currently supported by this action on $settings->sitename. Supported formats: " . implode(", ", $supported_formats) . "."));
+			}
+			
 		});
 		
 		/**
@@ -62,7 +82,7 @@ register_module([
 			
 			if(!in_array($format, $supported_formats)) {
 				http_response_code(400);
-				exit(page_renderer::render_main("Format error - $settings->sitename", "<p>Error: The format '$format' is not currently supported by $settings->sitename. Supported formats: " . implode(", ", $supported_formats) . "."));
+				exit(page_renderer::render_main("Format error - $settings->sitename", "<p>Error: The format '$format' is not currently supported by this action on $settings->sitename. Supported formats: " . implode(", ", $supported_formats) . "."));
 			}
 			
 			if(!isset($_GET["tag"]))
