diff --git a/modules/video_embed_wysiwyg/tests/src/Functional/TextFormatConfigurationTest.php b/modules/video_embed_wysiwyg/tests/src/Functional/TextFormatConfigurationTest.php
index 35f9a26..9df8e34 100644
--- a/modules/video_embed_wysiwyg/tests/src/Functional/TextFormatConfigurationTest.php
+++ b/modules/video_embed_wysiwyg/tests/src/Functional/TextFormatConfigurationTest.php
@@ -27,6 +27,8 @@ class TextFormatConfigurationTest extends BrowserTestBase {
     'image',
   ];
 
+  protected $formatUrl = 'admin/config/content/formats/manage/plain_text';
+
   /**
    * {@inheritdoc}
    */
@@ -34,7 +36,7 @@ class TextFormatConfigurationTest extends BrowserTestBase {
     parent::setUp();
 
     $this->drupalLogin($this->createAdminUser());
-    $this->drupalGet('admin/config/content/formats/manage/plain_text');
+    $this->drupalGet($this->formatUrl);
 
     // Setup the filter to have an editor.
     $this->getSession()->getPage()->find('css', '[name="editor[editor]"]')->setValue('ckeditor');
@@ -47,21 +49,21 @@ class TextFormatConfigurationTest extends BrowserTestBase {
    */
   public function testFormatConfiguration() {
     // Save the settings with the filter enabled, but with no button.
-    $this->drupalGet('admin/config/content/formats/manage/plain_text');
+    $this->drupalGet($this->formatUrl);
     $this->submitForm([
       'filters[video_embed_wysiwyg][status]' => TRUE,
       'editor[settings][toolbar][button_groups]' => '[]',
     ], t('Save configuration'));
     $this->assertSession()->pageTextContains('To embed videos, make sure you have enabled the "Video Embed WYSIWYG" filter and dragged the video icon into the WYSIWYG toolbar.');
 
-    $this->drupalGet('admin/config/content/formats/manage/plain_text');
+    $this->drupalGet($this->formatUrl);
     $this->submitForm([
       'filters[video_embed_wysiwyg][status]' => FALSE,
       'editor[settings][toolbar][button_groups]' => '[[{"name":"Group","items":["video_embed"]}]]',
     ], t('Save configuration'));
     $this->assertSession()->pageTextContains('To embed videos, make sure you have enabled the "Video Embed WYSIWYG" filter and dragged the video icon into the WYSIWYG toolbar.');
 
-    $this->drupalGet('admin/config/content/formats/manage/plain_text');
+    $this->drupalGet($this->formatUrl);
     $this->submitForm([
       'filters[video_embed_wysiwyg][status]' => TRUE,
       'editor[settings][toolbar][button_groups]' => '[[{"name":"Group","items":["video_embed"]}]]',
@@ -70,10 +72,34 @@ class TextFormatConfigurationTest extends BrowserTestBase {
   }
 
   /**
+   * Test the filter weights are in the correct order.
+   */
+  public function testWeightOrder() {
+    $this->drupalGet($this->formatUrl);
+    $this->submitForm([
+      // Enable the URL filter and the WYSIWYG embed.
+      'filters[filter_url][status]' => TRUE,
+      'filters[video_embed_wysiwyg][status]' => TRUE,
+      'editor[settings][toolbar][button_groups]' => '[[{"name":"Group","items":["video_embed"]}]]',
+      // Setup the weights so the URL filter runs first.
+      'filters[video_embed_wysiwyg][weight]' => '10',
+      'filters[filter_url][weight]' => '-10',
+    ], 'Save configuration');
+    $this->assertSession()->pageTextContains('The "Video Embed WYSIWYG" filter must run before the "Convert URLs into links" filter to function correctly.');
+
+    // Submit the form with the weights reversed.
+    $this->submitForm([
+      'filters[video_embed_wysiwyg][weight]' => '-10',
+      'filters[filter_url][weight]' => '10',
+    ], 'Save configuration');
+    $this->assertSession()->pageTextContains('The text format Plain text has been updated.');
+  }
+
+  /**
    * Test the dialog defaults can be set and work correctly.
    */
   public function testDialogDefaultValues() {
-    $this->drupalGet('admin/config/content/formats/manage/plain_text');
+    $this->drupalGet($this->formatUrl);
 
     // Assert all the form fields that appear on the modal, appear as
     // configurable defaults.
diff --git a/modules/video_embed_wysiwyg/video_embed_wysiwyg.module b/modules/video_embed_wysiwyg/video_embed_wysiwyg.module
index dacd9e4..0f06328 100644
--- a/modules/video_embed_wysiwyg/video_embed_wysiwyg.module
+++ b/modules/video_embed_wysiwyg/video_embed_wysiwyg.module
@@ -20,6 +20,7 @@ function video_embed_wysiwyg_ckeditor_css_alter(array &$css, Editor $editor) {
  */
 function video_embed_wysiwyg_form_filter_format_form_alter(&$form, $form_state, $form_id) {
   $form['#validate'][] = 'video_embed_wysiwyg_toolbar_filter_validate';
+  $form['#validate'][] = 'video_embed_wysiwyg_filter_weight_validate';
 }
 
 /**
@@ -44,3 +45,17 @@ function video_embed_wysiwyg_toolbar_filter_validate($form, FormStateInterface $
     $form_state->setError($form['filters']['status']['video_embed_wysiwyg'], t('To embed videos, make sure you have enabled the "Video Embed WYSIWYG" filter and dragged the video icon into the WYSIWYG toolbar.'));
   }
 }
+
+/**
+ * Validate the filters are not in an order that will cause conflicts.
+ */
+function video_embed_wysiwyg_filter_weight_validate($form, FormStateInterface $form_state) {
+  $wysiwyg_filter_enabled = !empty($form_state->getValue(['filters', 'video_embed_wysiwyg', 'status']));
+  $url_filter_enabled = !empty($form_state->getValue(['filters', 'filter_url', 'status']));
+  if (!$wysiwyg_filter_enabled || !$url_filter_enabled) {
+    return;
+  }
+  if ($form_state->getValue(['filters', 'video_embed_wysiwyg', 'weight']) > $form_state->getValue(['filters', 'filter_url', 'weight'])) {
+    $form_state->setError($form['filters']['status']['video_embed_wysiwyg'], t('The "Video Embed WYSIWYG" filter must run before the "Convert URLs into links" filter to function correctly.'));
+  }
+}
