• 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)

    (@ipstenu)

    ?????? Advisor and Activist

    What are your comment approval settings?

    Thread Starter Gal Baras

    (@galbaras)

    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)

    (@ipstenu)

    ?????? Advisor and Activist

    It’s possibly the one about the queue actually. Try turning that off for a bit.

    Thread Starter Gal Baras

    (@galbaras)

    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.

    ++++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

    (@galbaras)

    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

    (@galbaras)

    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.