Title: Automatically approving self pingbacks
Last modified: August 22, 2016

---

# Automatically approving self pingbacks

 *  [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * (@galbaras)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/automatically-approving-self-pingbacks/)
 * When I add a link to one of my posts to a newly published post, I see a new item
   in the comment moderation queue.
 * When pingbacks are from the same site, they should be approved automatically.
 * Thanks,
    Gal

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [11 years, 11 months ago](https://wordpress.org/support/topic/automatically-approving-self-pingbacks/#post-5215678)
 * What are your comment approval settings?
 *  Thread Starter [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * (@galbaras)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/automatically-approving-self-pingbacks/#post-5215684)
 * The following are turned on:
 * Attempt to notify any blogs linked to from the article
    Allow link notifications
   from other blogs (pingbacks and trackbacks) Allow people to post comments on 
   new articles Comment author must fill out name and e-mail Comment author must
   have a previously approved comment
 * Hold a comment in the queue if it contains 2 or more links
 * All the rest are off and there are no exclusions.
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [11 years, 11 months ago](https://wordpress.org/support/topic/automatically-approving-self-pingbacks/#post-5215690)
 * It’s possibly the one about the queue actually. Try turning that off for a bit.
 *  Thread Starter [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * (@galbaras)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/automatically-approving-self-pingbacks/#post-5215693)
 * Why would that matter? Looking at the trackbacks in question, none of them contain
   ANY links, let alone 2. Also, this is the default setting in WordPress.
 * Mike, it makes no sense to filter self referencing links and it should be dead
   easy to figure this out and pre-approve them.
 *  [Charly86](https://wordpress.org/support/users/charly86/)
 * (@charly86)
 * [11 years ago](https://wordpress.org/support/topic/automatically-approving-self-pingbacks/#post-5215751)
 * ++++1
 * Selfpings should have an option to auto approve, it’s really a pain each time
   I publish a article and I’ve got lot of cross reference.
 *  Thread Starter [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * (@galbaras)
 * [11 years ago](https://wordpress.org/support/topic/automatically-approving-self-pingbacks/#post-5215752)
 * Not sure if it’s working yet, but I think it will:
 *     ```
       // Approve self comments, pingbacks and trackbacks automatically
       add_filter( 'preprocess_comment', 'pre_approve_local_authors' );
       function pre_approve_local_authors( $commentdata ) {
       	if ( home_url() === substr( $commentdata['comment_author_url'], 0, strlen( home_url() ) ) ) {
       		$commentdata['comment_approved'] = 1;
       	}
       	return $commentdata;
       }
       ```
   
 * To limit this to work only on a particular comment type, check $commentdata[‘
   comment_type’] first.
 *  Thread Starter [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * (@galbaras)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/automatically-approving-self-pingbacks/#post-5215754)
 * If anyone cares, I’ve found an issue with my code, which used the number 1, instead
   of the string ‘1’ for approval. I’ve also improved the check slightly.
 *     ```
       // Approve self comments, pingbacks and trackbacks automatically
       add_filter( 'preprocess_comment', 'pre_approve_local_authors' );
       function pre_approve_local_authors( $commentdata ) {
       	if ( strstr( $commentdata['comment_author_url'], home_url() ) ) {
       		$commentdata['comment_approved'] = '1';
       	}
       	return $commentdata;
       }
       ```
   
 * Still haven’t nailed it, but if anyone’s game to test and post feedback, that’d
   be great.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Automatically approving self pingbacks’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 3 participants
 * Last reply from: [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/automatically-approving-self-pingbacks/#post-5215754)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
