Index: src/wp-admin/admin-ajax.php
===================================================================
--- src/wp-admin/admin-ajax.php	(revision 42819)
+++ src/wp-admin/admin-ajax.php	(working copy)
@@ -129,6 +129,7 @@
 	'get-post-thumbnail-html',
 	'get-community-events',
 	'edit-theme-plugin-file',
+	'wp-privacy-export-personal-data',
 );
 
 // Deprecated
Index: src/wp-admin/includes/ajax-actions.php
===================================================================
--- src/wp-admin/includes/ajax-actions.php	(revision 42819)
+++ src/wp-admin/includes/ajax-actions.php	(working copy)
@@ -4326,3 +4326,37 @@
 		);
 	}
 }
+
+function wp_ajax_wp_privacy_export_personal_data() {
+	check_ajax_referer( 'wp-privacy-export-personal-data', 'security' );
+
+	if ( ! current_user_can( 'manage_options' ) ) {
+		wp_send_json_error( 'access denied' );
+	}
+
+	$email_address  = $_POST['email'];
+	$exporter_index = $_POST['exporter'];
+	$page           = $_POST['page'];
+
+	$exporters = apply_filters( 'wp_privacy_personal_data_exporters', array() );
+
+	if ( ! is_email( $email_address ) ) {
+		wp_send_json_error( 'a valid email address must be given' );
+	}
+
+	if ( $exporter_index < 0 ) {
+		wp_send_json_error( 'exporter index cannot be negative' );
+	}
+
+	if ( $exporter_index > count( $exporters ) - 1 ) {
+		wp_send_json_error( 'exporter index out of range' );
+	}
+
+	if ( $page < 0 ) {
+		wp_send_json_error( 'page index cannot be negative' );
+	}
+
+	$response = call_user_func( $exporters[ $exporter_index ]['callback'], $email_address, $page );
+
+	wp_send_json_success( $response );
+}
Index: src/wp-admin/privacy.php
===================================================================
--- src/wp-admin/privacy.php	(revision 42819)
+++ src/wp-admin/privacy.php	(working copy)
@@ -16,8 +16,12 @@
 // "Borrow" xfn.js for now so we don't have to create new files.
 // wp_enqueue_script( 'xfn' );
 
+$title = __( 'Privacy Tools' );
+
 $action = isset( $_POST['action'] ) ? $_POST['action'] : '';
 
+$doing_personal_data_export_for_email = '';
+
 if ( ! empty( $action ) ) {
 	check_admin_referer( $action );
 
@@ -24,7 +28,6 @@
 	if ( 'set-privacy-page' === $action ) {
 		$privacy_policy_page_id = isset( $_POST['page_for_privacy_policy'] ) ? (int) $_POST['page_for_privacy_policy'] : 0;
 		update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id );
-
 		add_settings_error(
 			'page_for_privacy_policy',
 			'page_for_privacy_policy',
@@ -57,14 +60,38 @@
 				'updated'
 			);
 		}
+	} elseif ( 'export-personal-data' === $action ) {
+		$username_or_email_address = isset( $_POST['username_or_email_to_export'] ) ? $_POST['username_or_email_to_export'] : '';
+		$username_or_email_address = sanitize_text_field( $username_or_email_address );
+
+		if ( ! is_email( $username_or_email_address ) ) {
+			$user = get_user_by( 'login', $username_or_email_address );
+			if ( ! $user instanceof WP_User ) {
+				add_settings_error(
+					'username_or_email_to_export',
+					'username_or_email_to_export',
+					__( 'Unable to export personal data. Username not recognized.' ),
+					'error'
+				);
+			} else {
+				$doing_personal_data_export_for_email = $user->user_email;
+			}
+		} else {
+			$doing_personal_data_export_for_email = $username_or_email_address;
+		}
+
+		if ( ! empty( $doing_personal_data_export_for_email ) ) {
+			$title = __( 'Export Personal Data' );
+		}
 	}
 }
 
-// If a privacy policy page ID is available, make sure the page actually exists. If not, display a warning
-$privacy_policy_page_exists = false;
-$privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
+if ( empty( $doing_personal_data_export_for_email ) ) {
+	// If a privacy policy page ID is available, make sure the page actually exists. If not, display a warning
+	$privacy_policy_page_exists = false;
+	$privacy_policy_page_id     = (int) get_option( 'wp_page_for_privacy_policy' );
 
-if ( ! empty( $privacy_policy_page_id ) ) {
+	if ( ! empty( $privacy_policy_page_id ) ) {
 		$privacy_policy_page = get_post( $privacy_policy_page_id );
 		if ( ! $privacy_policy_page instanceof WP_Post ) {
 			add_settings_error(
@@ -79,6 +106,7 @@
 					'page_for_privacy_policy',
 					'page_for_privacy_policy',
 					sprintf(
+						/* translators: URL to trashed pages list view */
 						__( 'The currently selected privacy policy page is in the trash. Please create or select new privacy policy page or <a href="%s">restore the current page</a>.' ),
 						'edit.php?post_status=trash&post_type=page'
 					),
@@ -88,21 +116,20 @@
 				$privacy_policy_page_exists = true;
 			}
 		}
-}
+	}
 
-$title = __( 'Privacy Tools' );
+	get_current_screen()->add_help_tab( array(
+		'id'      => 'privacy',
+		'title'   => __( 'Privacy' ),
+		'content' => '<p>' . __( 'This page provides tools with which you can manage your user\'s personal data and site\'s privacy policy.' ) . '</p>',
+	) );
 
-get_current_screen()->add_help_tab( array(
-	'id'      => 'privacy',
-	'title'   => __( 'Privacy' ),
-	'content' => '<p>' . __( 'This page provides tools with which you can manage your user\'s personal data and site\'s privacy policy.' ) . '</p>',
-) );
+	get_current_screen()->set_help_sidebar(
+		'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+		'<p>' . __( '<a href="#">Documentation on privacy</a>' ) . '</p>'
+	);
+}
 
-get_current_screen()->set_help_sidebar(
-	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
-	'<p>' . __( '<a href="#">Documentation on privacy</a>' ) . '</p>'
-);
-
 require_once( ABSPATH . 'wp-admin/admin-header.php' );
 
 ?>
@@ -109,91 +136,223 @@
 <div class="wrap">
 	<h1><?php echo esc_html( $title ); ?></h1>
 	<?php settings_errors(); ?>
+	<?php
 
-	<h2 class="title"><?php _e( 'Privacy policy page' ); ?></h2>
-	<table class="form-table">
+	// If we have an email address, bootstrap the exporter
+	if ( ! empty( $doing_personal_data_export_for_email ) ) {
+		if ( $username_or_email_address === $doing_personal_data_export_for_email ) {
+			$heading = sprintf(
+				/* translators: An email address */
+				__( 'Exporting personal data for %s' ),
+				$doing_personal_data_export_for_email
+			);
+		} else {
+			$heading = sprintf(
+				/* translators: An email address and a username */
+				__( 'Exporting personal data for %1$s (%2$s)' ),
+				$doing_personal_data_export_for_email,
+				$username_or_email_address
+			);
+		}
+		?>
+		<p>
+			<?php echo esc_html( $heading ); ?>
+		</p>
+
+		<div id="exporters-container">
+			<ul id="exporter-list">
+			</ul>
+			<table class="wp-list-table widefat striped" id="exported-data-table">
+				<tr>
+					<th><?php _e( 'Name' ); ?></th>
+					<th><?php _e( 'Value' ); ?></th>
+				</tr>
+			</table>
+		</div>
+
 		<?php
+		// Build the array of exporters and emit it as an array accessible to javascript along with a nonce
+		$exporters = apply_filters( 'wp_privacy_personal_data_exporters', array() );
 
-		if ( $privacy_policy_page_exists ) {
-			$edit_href = add_query_arg(
-				array(
-					'post'  => $privacy_policy_page_id,
-					'action' => 'edit',
-				),
-				admin_url( 'post.php' )
-			);
-			$view_href = get_permalink( $privacy_policy_page_id );
-
-			?>
-			<tr>
-				<th colspan="2">
-					<?php
-					printf(
-						__( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy.' ),
-						$edit_href,
-						$view_href
-					);
-					?>
-				</th>
-			</tr>
-			<?php
+		$exporter_names = array();
+		foreach ( (array) $exporters as $exporter ) {
+			$exporter_names[] = $exporter['exporter_friendly_name'];
 		}
 
 		?>
-		<tr>
-			<th scope="row">
+
+		<!-- scripts for the exporter -->
+
+		<script>
+			( function( $ ) {
+				$( document ).ready( function() {
+					var nonce = <?php echo json_encode( wp_create_nonce( 'wp-privacy-export-personal-data' ) ); ?>;
+					var exportForEmail = <?php echo json_encode( $doing_personal_data_export_for_email ); ?>;
+					var exporterNames = <?php echo json_encode( $exporter_names ); ?>;
+					var successMessage = "<?php echo esc_attr( __( 'Export completed successfully' ) ); ?>";
+					var failureMessage = "<?php echo esc_attr( __( 'A failure occurred during export' ) ); ?>";
+
+					function on_exports_done_success() {
+						$( '#exporters-container' ).append( '<p>' + successMessage + '</p>' );
+					}
+
+					function on_export_failure( textStatus, error ) {
+						$( '#exporters-container' ).append( '<p>' + failureMessage + '</p>' );
+						$( '#exporters-container' ).append( '<p>' + textStatus + '</p>' );
+					}
+
+					function do_next_export( exporterIndex, pageIndex ) {
+						$.ajax( {
+							url: ajaxurl,
+							data: {
+								action: 'wp-privacy-export-personal-data',
+								email: exportForEmail,
+								exporter: exporterIndex,
+								page: pageIndex,
+								security: nonce,
+							},
+							method: 'post'
+						} ).done( function( response ) {
+							var responseData = response.data;
+							for ( var dataIndex = 0; dataIndex < responseData.data.length; dataIndex++ ) {
+								$( '#exported-data-table' ).append( '<tr><td>' + responseData.data[ dataIndex ].name + '</td><td>' + responseData.data[ dataIndex ].value + '</td></tr>' );
+							}
+							if ( ! responseData.done ) {
+								setTimeout( do_next_export( exporterIndex, pageIndex + 1 ) );
+							} else {
+								if ( exporterIndex < exporterNames.length - 1 ) {
+									setTimeout( do_next_export( exporterIndex + 1, 0 ) );
+								} else {
+									on_exports_done_success();
+								}
+							}
+						} ).fail( function( jqxhr, textStatus, error ) {
+							on_export_failure( textStatus, error );
+						} );
+					}
+
+					// And now, let's begin
+					do_next_export( 0, 0 );
+				} )
+			} ) ( jQuery );
+		</script>
+
+		<p>
+			<a href="privacy.php"><?php esc_html_e( 'Return to privacy tools' ); ?></a>
+		</p>
+		<?php
+	} else {
+		// No email address to export for? Then just display the privacy tools form table
+		?>
+		<h2 class="title"><?php _e( 'Privacy policy page' ); ?></h2>
+		<table class="form-table">
 			<?php
 
 			if ( $privacy_policy_page_exists ) {
-				_e( 'Select another page for your privacy policy' );
-			} else {
-				_e( 'Select an existing privacy policy page' );
+				$edit_href = add_query_arg(
+					array(
+						'post'   => $privacy_policy_page_id,
+						'action' => 'edit',
+					),
+					admin_url( 'post.php' )
+				);
+				$view_href = get_permalink( $privacy_policy_page_id );
+
+				?>
+				<tr>
+					<th colspan="2">
+						<?php
+						printf(
+							/* translators: URL to edit the privacy policy page, URL to view the privacy policy page */
+							__( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy.' ),
+							$edit_href,
+							$view_href
+						);
+						?>
+					</th>
+				</tr>
+				<?php
 			}
 
 			?>
-			</th>
-			<td id="front-static-pages">
-				<form method="post" action="">
-					<?php wp_nonce_field( 'set-privacy-page' ); ?>
-					<input type="hidden" name="action" value="set-privacy-page" />
-					<fieldset>
-						<legend class="screen-reader-text"><span><?php _e( 'Select your privacy policy page.' ); ?></span></legend>
-						<label for="page_for_privacy_policy">
-							<?php wp_dropdown_pages(
-								array(
-									'name'              => 'page_for_privacy_policy',
-									'show_option_none'  => __( '&mdash; Select &mdash;' ),
-									'option_none_value' => '0',
-									'selected'          => $privacy_policy_page_id,
-									'post_status'       => array( 'draft', 'publish' ),
-								)
-							);
-							?>
-						</label>
-					</fieldset>
-						<?php submit_button( __( 'Set Page' ) ); ?>
-				</form>
-			</td>
-		</tr>
-		<?php
+			<tr>
+				<th scope="row">
+				<?php
 
-		if ( ! $privacy_policy_page_exists ) {
+				if ( $privacy_policy_page_exists ) {
+					_e( 'Select another page for your privacy policy' );
+				} else {
+					_e( 'Select an existing privacy policy page' );
+				}
+
+				?>
+				</th>
+				<td id="privacy-policy-page">
+					<form method="post" action="">
+						<?php wp_nonce_field( 'set-privacy-page' ); ?>
+						<input type="hidden" name="action" value="set-privacy-page" />
+						<fieldset>
+							<legend class="screen-reader-text"><span><?php _e( 'Select your privacy policy page.' ); ?></span></legend>
+							<label for="page_for_privacy_policy">
+								<?php
+								wp_dropdown_pages(
+									array(
+										'name'             => 'page_for_privacy_policy',
+										'show_option_none' => __( '&mdash; Select &mdash;' ),
+										'option_none_value' => '0',
+										'selected'         => $privacy_policy_page_id,
+										'post_status'      => array( 'draft', 'publish' ),
+									)
+								);
+								?>
+							</label>
+						</fieldset>
+							<?php submit_button( __( 'Set Page' ) ); ?>
+					</form>
+				</td>
+			</tr>
+			<?php
+
+			if ( ! $privacy_policy_page_exists ) {
+				?>
+				<tr>
+					<th scope="row"><?php _e( 'Create new page for your privacy policy' ); ?></th>
+					<td>
+						<form method="post" action="">
+							<input type="hidden" name="action" value="create-privacy-page" />
+							<?php wp_nonce_field( 'create-privacy-page' ); ?>
+							<?php submit_button( __( 'Create Page' ) ); ?>
+						</form>
+					</td>
+				</tr>
+				<?php
+			}
 			?>
+		</table>
+
+		<h2 class="title"><?php _e( 'Personal Data Management' ); ?></h2>
+		<table class="form-table">
 			<tr>
-				<th scope="row"><?php _e( 'Create new page for your privacy policy' ); ?></th>
-				<td>
+				<th scope="row"><?php _e( 'Export personal data' ); ?></th>
+				<td id="export-personal-data-form-container">
 					<form method="post" action="">
-						<input type="hidden" name="action" value="create-privacy-page" />
-						<?php wp_nonce_field( 'create-privacy-page' ); ?>
-						<?php submit_button( __( 'Create Page' ) ); ?>
+						<input type="hidden" name="action" value="export-personal-data" />
+						<?php wp_nonce_field( 'export-personal-data' ); ?>
+						<fieldset>
+							<legend class="screen-reader-text"><span><?php _e( 'Enter the username or email address of the user whose personal data you wish to export' ); ?></span></legend>
+							<label for="username_or_email_to_export">
+								<input type="text" class="regular-text" name="username_or_email_to_export" />
+							</label>
+							<p class="description"><?php _e( 'The username or email address of the user whose personal data you wish to export' ); ?></p>
+						</fieldset>
+						<?php submit_button( __( 'Begin Export' ) ); ?>
 					</form>
 				</td>
 			</tr>
-			<?php
-		}
-
-		?>
-	</table>
+		</table>
+		<?php
+	}
+	?>
 </div>
 
 <?php
Index: src/wp-includes/comment.php
===================================================================
--- src/wp-includes/comment.php	(revision 42819)
+++ src/wp-includes/comment.php	(working copy)
@@ -3274,3 +3274,77 @@
 
 	return get_comment( $comment_id );
 }
+
+/**
+ * Registers the personal data exporter for comments
+ *
+ * @param array   $exporters   An array of personal data exporters.
+ * @return array  An array of personal data exporters.
+ */
+function wp_register_comment_personal_data_exporter( $exporters ) {
+	$exporters[] = array(
+		'exporter_friendly_name' => __( 'WordPress Comments' ),
+		'callback'               => 'wp_comments_personal_data_exporter',
+	);
+
+	return $exporters;
+}
+
+/**
+ * Finds and exports data which could be used to identify a person from comments assocated with an email address.
+ *
+ * @param string  $email  The comment author email address.
+ * @param int     $page   Comment page, zero based.
+ * @return array  An array of personal data in name value pairs
+ */
+function wp_comments_personal_data_exporter( $email_address, $page ) {
+
+	$personal_data = array();
+
+	// Technically, strtolower isn't necessary since get_comments will match email insensitive
+	// But it is a good example for plugin developers whose targets might not be as generous
+	$email_address = trim( strtolower( $email_address ) );
+
+	// Limit us to 100 comments at a time to avoid timing out
+	$number = 100;
+	$offset = $number * (int) $page;
+
+	$comments = get_comments(
+		array(
+			'author_email' => $email_address,
+			'number'       => $number,
+			'offset'       => $offset,
+			'order_by'     => 'comment_ID',
+			'order'        => 'ASC',
+		)
+	);
+
+	$comment_personal_data_props = array(
+		'comment_author'       => __( 'Comment Author' ),
+		'comment_author_email' => __( 'Comment Author Email' ),
+		'comment_author_url'   => __( 'Comment Author URL' ),
+		'comment_author_IP'    => __( 'Comment Author IP' ),
+		'comment_agent'        => __( 'Comment Agent' ),
+	);
+
+	foreach ( (array) $comments as $comment ) {
+		foreach ( (array) $comment_personal_data_props as $key => $description ) {
+			$value = $comment->$key;
+			if ( ! empty( $value ) ) {
+				/* translators: %1$d: ID of a comment, %2$s: Description of a comment field */
+				$name            = sprintf( __( 'Comment %1$d : %2$s' ), $comment->comment_ID, $description );
+				$personal_data[] = array(
+					'name'  => $name,
+					'value' => $value,
+				);
+			}
+		}
+	}
+
+	$done = count( $comments ) <= 0;
+
+	return array(
+		'data' => $personal_data,
+		'done' => $done,
+	);
+}
Index: src/wp-includes/default-filters.php
===================================================================
--- src/wp-includes/default-filters.php	(revision 42819)
+++ src/wp-includes/default-filters.php	(working copy)
@@ -328,6 +328,7 @@
 add_action( 'do_pings', 'do_all_pings', 10, 1 );
 add_action( 'do_robots', 'do_robots' );
 add_action( 'set_comment_cookies', 'wp_set_comment_cookies', 10, 3 );
+add_filter( 'wp_privacy_personal_data_exporters', 'wp_register_comment_personal_data_exporter', 10 );
 add_action( 'sanitize_comment_cookies', 'sanitize_comment_cookies' );
 add_action( 'admin_print_scripts', 'print_emoji_detection_script' );
 add_action( 'admin_print_scripts', 'print_head_scripts', 20 );
