WordPress.org

Make WordPress Core

Opened 3 months ago

Last modified 3 months ago

#53060 new feature request

Data Deletion - comments

Reported by: megphillips91 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Query Keywords:
Focuses: privacy Cc:

Description

Data Deletion - comments
Can we add a WP_Query parameter so that we can pull comments by author email or author user_id?

Why?
For better user privacy, I am creating a profile page for users where they can see all the comments they have made and easily delete those comments -- but in a post loop so that they have the context of the comments that they have made.

Reference
https://developer.wordpress.org/reference/classes/wp_query/#comment-parameters
It seems there is no WP_Query parameter for pulling posts by comment author. I think there should be for privacy.

Of course, I can make it happen the other way round with a custom DB query to find all comments by author and then get the post_id and loop the ids in_array but maybe it should be easier and more standard as to encourage user privacy respect.

Change History (5)

#1 follow-up: @audrasjb
3 months ago

Hi @megphillips91,

Why don't you use WP_Comment_Query instead of WP_Query?

I think it doesn't make much sense to add a comment_author_email parameter in WP_Query, as WP_Query returns Post objects, not Comment objects.

#2 in reply to: ↑ 1 ; follow-up: @megphillips91
3 months ago

Replying to audrasjb:

Hi @megphillips91,

Why don't you use WP_Comment_Query instead of WP_Query?

I think it doesn't make much sense to add a comment_author_email parameter in WP_Query, as WP_Query returns Post objects, not Comment objects.

I understand your concern. However, a commenter could not make an informed decision on whether or not to delete a comment without the context of the post itself. For instance, if I commented "that bow is soooo awesome", I could be referring to the bow of a boat or the ribbon in my niece's hair.

You see, for privacy and data deletion purposes (a worthy and common use case), one would need to provide the proper context for good decision making - which in this case is the post onto which a commenter commented.

The request is not because I cannot achieve this in some other way. (I should probably be using WP Comment Query in the below as you mentioned. The request is driven by my own (and I hope others') sincere desire to make data deletion a priority and a simple thing to achieve.

Last edited 3 months ago by megphillips91 (previous) (diff)

#3 @megphillips91
3 months ago

One more thought is that maybe we could offer a "proposed" data deletion page into the core pages just like we offer a "proposed" privacy policy.

I am adding in this drafted page anyway because it is now required for SSO with FB and others. So if we did provide a page like that, then I guess that would be so much better than adding something into WP Query. ╰(▔∀▔)╯

Okay, I think I've just about written all my thoughts around this topic. A data deletion page does seem like something that every site owner should provide and I would like to see a way for that to be easier for WP users.

I personally would like to have written something else today. This seems rather basic.

Last edited 3 months ago by megphillips91 (previous) (diff)

#4 in reply to: ↑ 2 @dd32
3 months ago

Replying to megphillips91:

I understand your concern. However, a commenter could not make an informed decision on whether or not to delete a comment without the context of the post itself. For instance, if I commented "that bow is soooo awesome", I could be referring to the bow of a boat or the ribbon in my niece's hair.

To provide the proper context for that, you'd use WP_Comment_Query to pull a list of comments, and then display the post associated with those comments in-line. get_post( $comment->comment_post_ID ). Querying posts by comment author email is a very niche use-case that would serve very little audience that WP_Comment_Query doesn't already offer a viable option for.

#5 @megphillips91
3 months ago

Thank you for the consideration. I agree that it is simple to get to...I think my goal may have been misaligned with the original request. Any thoughts on a data deletion page in core?

Note: See TracTickets for help on using tickets.