diff --git src/wp-includes/formatting.php src/wp-includes/formatting.php
index dc97605..3d0d0f7 100644
--- src/wp-includes/formatting.php
+++ src/wp-includes/formatting.php
@@ -3039,7 +3039,7 @@ function wp_rel_nofollow_callback( $matches ) {
  */
 function wp_targeted_link_rel( $text ) {
 	// Don't run (more expensive) regex if no links with targets.
-	if ( stripos( $text, 'target' ) !== false && stripos( $text, '<a ' ) !== false ) {
+	if ( stripos( $text, ' target' ) !== false && stripos( $text, '<a ' ) !== false ) {
 		$text = preg_replace_callback( '|<a\s([^>]*target\s*=[^>]*)>|i', 'wp_targeted_link_rel_callback', $text );
 	}
 
diff --git tests/phpunit/tests/formatting/WPTargetedLinkRel.php tests/phpunit/tests/formatting/WPTargetedLinkRel.php
index 08f8ac1..4655d2c 100644
--- tests/phpunit/tests/formatting/WPTargetedLinkRel.php
+++ tests/phpunit/tests/formatting/WPTargetedLinkRel.php
@@ -101,4 +101,16 @@ class Tests_Targeted_Link_Rel extends WP_UnitTestCase {
 
 		$this->assertEquals( $expected, $post->post_content );
 	}
+
+	/**
+	 * Ensure the data-target attribute is ignored.
+	 *
+	 * @ticket 46886.
+	 */
+	public function test_ignore_data_target_attribute() {
+		$content  = '<a href="https://example.com" data-target="thisandthat">click here</a>';
+		$expected = $content;
+		$this->assertSame( $expected, wp_targeted_link_rel( $content ) );
+	}
+
 }
