diff --git a/stacktable.module b/stacktable.module
index 7eee85c53031cddd70ebabe87880cd137a1656a2..eae3e95ae7a0f0e8b40aadf119e2ed205952019f 100644
--- a/stacktable.module
+++ b/stacktable.module
@@ -11,6 +11,11 @@ use Drupal\Core\Render\Markup;
  * Implements hook_page_attachments().
  */
 function stacktable_page_attachments(array &$page) {
+  // Don't enable in admin.
+  if (\Drupal::service('router.admin_context')->isAdminRoute()) {
+    return;
+  }
+
   $config = \Drupal::config('stacktable.settings');
   $page['#attached']['library'][] = 'stacktable/stacktablejs_init';
 
@@ -38,6 +43,11 @@ function stacktable_page_attachments(array &$page) {
  * Adds label for the placeholder for tables that are opened in modal.
  */
 function stacktable_preprocess_html(&$variables) {
+  // Don't enable in admin.
+  if (\Drupal::service('router.admin_context')->isAdminRoute()) {
+    return;
+  }
+
   $config = \Drupal::config('stacktable.settings');
 
   // Sub-feature of "On demand" method is opening the table in modal - add