diff --git a/src/js/_enqueues/admin/privacy-tools.js b/src/js/_enqueues/admin/privacy-tools.js index 4e12939be7621..480766ad051d7 100644 --- a/src/js/_enqueues/admin/privacy-tools.js +++ b/src/js/_enqueues/admin/privacy-tools.js @@ -296,8 +296,10 @@ jQuery( function( $ ) { range = document.createRange(); $parent.addClass( 'hide-privacy-policy-tutorial' ); - // Copy action. - range.selectNodeContents( $parent[0] ); + // Copy action. Select only the dedicated copy-content wrapper + // so the actions toolbar (which contains the "Copied!" notice + // and button label) is never part of the selection - see #58969. + range.selectNodeContents( $parent.find( '.privacy-text-copy-content' )[0] ); window.getSelection().addRange( range ); document.execCommand( 'copy' ); diff --git a/src/wp-admin/includes/class-wp-privacy-policy-content.php b/src/wp-admin/includes/class-wp-privacy-policy-content.php index c505df9b81644..14f94a472ed01 100644 --- a/src/wp-admin/includes/class-wp-privacy-policy-content.php +++ b/src/wp-admin/includes/class-wp-privacy-policy-content.php @@ -420,10 +420,12 @@ public static function privacy_policy_guide() {