diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 337f383..6ac5e6f 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -2763,6 +2763,7 @@ function template_preprocess_page(&$variables) {
   $variables['site_name']         = (theme_get_setting('features.name') ? check_plain($site_config->get('name')) : '');
   $variables['site_slogan']       = (theme_get_setting('features.slogan') ? filter_xss_admin($site_config->get('slogan')) : '');
   $variables['tabs']              = menu_local_tabs();
+  $variables['title'] = new RenderWrapper('drupal_get_title');
 
   // Pass the main menu and secondary menu to the template as render arrays.
   if (!empty($variables['main_menu'])) {
@@ -2823,9 +2824,6 @@ function template_process_page(&$variables) {
       '#breadcrumb' => \Drupal::service('breadcrumb')->build(\Drupal::service('request')->attributes->all()),
     );
   }
-  if (!isset($variables['title'])) {
-    $variables['title'] = drupal_get_title();
-  }
 
   // Generate messages last in order to capture as many as possible for the
   // current page.
