diff --git a/payment/uc_payment/lib/Drupal/uc_payment/Form/OrderPaymentsForm.php b/payment/uc_payment/lib/Drupal/uc_payment/Form/OrderPaymentsForm.php
index 09bda95..db88399 100644
--- a/payment/uc_payment/lib/Drupal/uc_payment/Form/OrderPaymentsForm.php
+++ b/payment/uc_payment/lib/Drupal/uc_payment/Form/OrderPaymentsForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\uc_payment\Form;
 
+use Drupal\Component\Utility\Xss;
 use Drupal\Core\Form\FormBase;
 use Drupal\uc_order\UcOrderInterface;
 use Drupal\uc_payment\Plugin\PaymentMethodManager;
@@ -101,7 +102,7 @@ class OrderPaymentsForm extends FormBase {
           '#price' => $total,
         );
         $form['payments'][$payment->receipt_id]['comment'] = array(
-          '#markup' => ($payment->comment == '') ? '-' : filter_xss_admin($payment->comment),
+          '#markup' => ($payment->comment == '') ? '-' : Xss::filterAdmin($payment->comment),
         );
         if ($account->hasPermission('delete payments')) {
           $action_value = l(t('Delete'), 'admin/store/orders/' . $this->order->id() . '/payments/'
diff --git a/payment/uc_payment/uc_payment.module b/payment/uc_payment/uc_payment.module
index bda8937..ca0d0c6 100644
--- a/payment/uc_payment/uc_payment.module
+++ b/payment/uc_payment/uc_payment.module
@@ -12,6 +12,7 @@
 
 use Drupal\uc_order\UcOrderInterface;
 use Drupal\Component\Plugin\Exception\PluginException;
+use Drupal\Component\Utility\Xss;
 
 require_once dirname(__FILE__) . '/uc_payment_order_pane.inc';
 
@@ -69,7 +70,7 @@ function template_preprocess_uc_payment_totals(&$variables) {
   $variables['line_items'] = uc_order_load_line_items_display($variables['order']);
 
   foreach ($variables['line_items'] as $key => $line) {
-    $variables['line_items'][$key]['title'] = filter_xss($line['title']);
+    $variables['line_items'][$key]['title'] = Xss::filter($line['title']);
     $variables['line_items'][$key]['amount'] = uc_currency_format($line['amount']);
   }
 }
diff --git a/shipping/uc_quote/uc_quote.module b/shipping/uc_quote/uc_quote.module
index 9457235..8c656a4 100644
--- a/shipping/uc_quote/uc_quote.module
+++ b/shipping/uc_quote/uc_quote.module
@@ -9,6 +9,7 @@
  * their specific information so that a shipment may be quoted and requested.
  */
 
+use Drupal\Component\Utility\Xss;
 use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\PrependCommand;
 use Drupal\Core\Ajax\ReplaceCommand;
@@ -510,7 +511,7 @@ function uc_checkout_pane_quotes($op, &$order, $form = NULL, &$form_state = NULL
   $quote_config = \Drupal::config('uc_quote.settings');
   switch ($op) {
     case 'view':
-      $description = filter_xss_admin($quote_config->get('pane_description'));
+      $description = Xss::filterAdmin($quote_config->get('pane_description'));
 
       $contents['#attached']['css'][] = drupal_get_path('module', 'uc_quote') . '/css/uc_quote.css';
 
@@ -836,7 +837,7 @@ function uc_quote_build_quote_form($order, $show_errors = TRUE) {
   }
   elseif ($show_errors) {
     $return['error'] = array(
-      '#markup' => filter_xss_admin($quote_config->get('error_message')),
+      '#markup' => Xss::filterAdmin($quote_config->get('error_message')),
     );
   }
 
diff --git a/shipping/uc_shipping/uc_shipping.admin.inc b/shipping/uc_shipping/uc_shipping.admin.inc
index a8943e0..5224500 100644
--- a/shipping/uc_shipping/uc_shipping.admin.inc
+++ b/shipping/uc_shipping/uc_shipping.admin.inc
@@ -6,6 +6,7 @@
  */
 
 use Drupal\Component\Utility\Unicode;
+use Drupal\Component\Utility\Xss;
 
 /**
  * Displays a list of an order's packaged products.
@@ -135,7 +136,7 @@ function uc_shipping_new_package($form, &$form_state, $order) {
           '#markup' => check_plain($product->model)
         );
         $product_row['name'] = array(
-          '#markup' => filter_xss_admin($product->title)
+          '#markup' => Xss::filterAdmin($product->title)
         );
         $range = range(1, $unboxed_qty);
         $product_row['qty'] = array(
@@ -338,7 +339,7 @@ function uc_shipping_package_edit($form, &$form_state, $order, $package) {
       $product_row = array();
       $product_row['checked'] = array('#type' => 'checkbox', '#default_value' => isset($package->products[$product->order_product_id]));
       $product_row['model'] = array('#markup' => check_plain($product->model));
-      $product_row['name'] = array('#markup' => filter_xss_admin($product->title));
+      $product_row['name'] = array('#markup' => Xss::filterAdmin($product->title));
       $range = range(1, $product->qty);
       $product_row['qty'] = array(
         '#type' => 'select',
diff --git a/shipping/uc_shipping/uc_shipping.module b/shipping/uc_shipping/uc_shipping.module
index 15cd3d9..55d0339 100644
--- a/shipping/uc_shipping/uc_shipping.module
+++ b/shipping/uc_shipping/uc_shipping.module
@@ -8,6 +8,7 @@
  */
 
 use Drupal\Component\Utility\Json;
+use Drupal\Component\Utility\Xss;
 use Drupal\uc_store\Address;
 
 /**
@@ -349,7 +350,7 @@ function uc_shipping_package_view($package) {
     '#suffix' => '</div>',
   );
 
-  $rows[] = array(t('Contents:'), filter_xss_admin($package->description));
+  $rows[] = array(t('Contents:'), Xss::filterAdmin($package->description));
 
   if ($shipment) {
     $methods = \Drupal::moduleHandler()->invokeAll('uc_shipping_method');
diff --git a/uc_attribute/uc_attribute.module b/uc_attribute/uc_attribute.module
index 95c30a5..e6ef62e 100644
--- a/uc_attribute/uc_attribute.module
+++ b/uc_attribute/uc_attribute.module
@@ -12,6 +12,7 @@
  */
 
 use Drupal\Component\Utility\NestedArray;
+use Drupal\Component\Utility\Xss;
 use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\PrependCommand;
 use Drupal\Core\Ajax\ReplaceCommand;
@@ -1274,7 +1275,7 @@ function _uc_attribute_alter_form($id, &$product, $use_ajax) {
       $form_attributes[$attribute->aid]['#title'] = check_plain($name);
     }
 
-    $form_attributes[$attribute->aid]['#description'] = filter_xss($attribute->description);
+    $form_attributes[$attribute->aid]['#description'] = Xss::filter($attribute->description);
     $form_attributes[$attribute->aid]['#required'] = $attribute->required;
   }
 
diff --git a/uc_cart/uc_cart.module b/uc_cart/uc_cart.module
index f9187b0..f1f7e29 100644
--- a/uc_cart/uc_cart.module
+++ b/uc_cart/uc_cart.module
@@ -11,6 +11,7 @@
  */
 
 use Drupal\Component\Utility\UrlHelper;
+use Drupal\Component\Utility\Xss;
 
 /**
  * Time in seconds after which a cart order is deemed abandoned.
@@ -275,7 +276,7 @@ function uc_cart_complete_sale($order, $login = FALSE) {
 
   return array(
     '#theme' => 'uc_cart_complete_sale',
-    '#message' => filter_xss_admin($message),
+    '#message' => Xss::filterAdmin($message),
     '#order' => $order,
   );
 }
diff --git a/uc_order/uc_order.api.php b/uc_order/uc_order.api.php
index b09400f..a21f40b 100644
--- a/uc_order/uc_order.api.php
+++ b/uc_order/uc_order.api.php
@@ -338,7 +338,7 @@ function uc_order_pane_callback($op, $order, &$form = NULL, &$form_state = NULL)
       $comments = uc_order_comments_load($form['order_id']['#value'], TRUE);
       if (is_array($comments) && count($comments) > 0) {
         foreach ($comments as $comment) {
-          $items[] = '[' . theme('uc_uid', array('uid' => $comment->uid)) . '] ' . filter_xss_admin($comment->message);
+          $items[] = '[' . theme('uc_uid', array('uid' => $comment->uid)) . '] ' . \Drupal\Component\Utility\Xss::filterAdmin($comment->message);
         }
       }
       else {
diff --git a/uc_order/uc_order.module b/uc_order/uc_order.module
index 2d52152..b52c0b9 100644
--- a/uc_order/uc_order.module
+++ b/uc_order/uc_order.module
@@ -11,6 +11,7 @@
  */
 
 use Drupal\Core\Template\Attribute;
+use Drupal\Component\Utility\Xss;
 
 require_once dirname(__FILE__) . '/uc_order.order_pane.inc';
 require_once dirname(__FILE__) . '/uc_order.line_item.inc';
@@ -874,7 +875,7 @@ function template_preprocess_uc_order_invoice_page(&$variables) {
   $site_config = \Drupal::config('system.site');
   $head_title = array('name' => check_plain($site_config->get('name')));
   if ($site_config->get('slogan')) {
-    $head_title['slogan'] = strip_tags(filter_xss_admin($site_config->get('slogan')));
+    $head_title['slogan'] = strip_tags(Xss::filterAdmin($site_config->get('slogan')));
   }
 
   // Add favicon.
diff --git a/uc_order/uc_order.order_pane.inc b/uc_order/uc_order.order_pane.inc
index 827d016..8ad5793 100644
--- a/uc_order/uc_order.order_pane.inc
+++ b/uc_order/uc_order.order_pane.inc
@@ -10,6 +10,7 @@
  * default order panes are defined in uc_order_order_pane() in uc_order.module.
  */
 
+use Drupal\Component\Utility\Xss;
 use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\PrependCommand;
 use Drupal\Core\Ajax\ReplaceCommand;
@@ -978,7 +979,7 @@ function uc_order_pane_admin_comments($op, $order, &$form = NULL, &$form_state =
         $build['#rows'][] = array(
           array('data' => format_date($comment->created, 'short'), 'class' => array('date')),
           array('data' => array('#theme' => 'uc_uid', '#uid' => $comment->uid), 'class' => array('user')),
-          array('data' => filter_xss_admin($comment->message), 'class' => array('message')),
+          array('data' => Xss::filterAdmin($comment->message), 'class' => array('message')),
         );
       }
       return $build;
@@ -1002,7 +1003,7 @@ function uc_order_pane_admin_comments($op, $order, &$form = NULL, &$form_state =
           '#theme' => 'uc_uid',
           '#uid' => $comment->uid,
         );
-        $items[] = '[' . drupal_render($username) . '] ' . filter_xss_admin($comment->message);
+        $items[] = '[' . drupal_render($username) . '] ' . Xss::filterAdmin($comment->message);
       }
       $item_list = array(
         '#theme' => 'item_list',
diff --git a/uc_product/lib/Drupal/uc_product/Controller/ProductController.php b/uc_product/lib/Drupal/uc_product/Controller/ProductController.php
index 4392ca2..c15a018 100644
--- a/uc_product/lib/Drupal/uc_product/Controller/ProductController.php
+++ b/uc_product/lib/Drupal/uc_product/Controller/ProductController.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\uc_product\Controller;
 
+use Drupal\Component\Utility\Xss;
 use Drupal\Core\Controller\ControllerBase;
 
 /**
@@ -32,7 +33,7 @@ class ProductController extends ControllerBase {
       $rows[] = array(
         check_plain($class->type),
         check_plain($class->name),
-        filter_xss_admin($class->description),
+        Xss::filterAdmin($class->description),
         implode(' ', $ops),
       );
     }
