diff --git a/defaults.js b/defaults.js
index <HASH>..<HASH> 100644
--- a/defaults.js
+++ b/defaults.js
@@ -25,9 +25,11 @@ module.exports = {
     'apostrophe-attachments': {},
     'apostrophe-oembed': {},
     'apostrophe-pager': {},
+    // global comes first so it can register a doc type manager and clean things up before
+    // pages claims any orphan page types
+    'apostrophe-global': {},
     'apostrophe-pages': {},
     'apostrophe-search': {},
-    'apostrophe-global': {},
     'apostrophe-any-page-manager': {},
     'apostrophe-areas': {},
     'apostrophe-rich-text-widgets': {},
diff --git a/lib/modules/apostrophe-global/index.js b/lib/modules/apostrophe-global/index.js
index <HASH>..<HASH> 100644
--- a/lib/modules/apostrophe-global/index.js
+++ b/lib/modules/apostrophe-global/index.js
@@ -37,7 +37,16 @@ module.exports = {
         migrate: function(callback) {
           return self.apos.docs.db.update({
             slug: self.slug,
-            type: { $exists: 0 }
+            $or: [
+              // Could still be literally undefined, or it could have been
+              // patched by the orphan doc type creator
+              {
+                type: { $exists: 0 }
+              },
+              {
+                type: 'WASUNDEFINED'
+              }
+            ]
           }, {
             $set: {
               type: self.name
global doc type manager should come before pages module so it's not treated as an orphan doc type; migration should cope if it was previously given the type WASUNDEFINED by the orphan handler