trackback( string $trackback_url, string $title, string $excerpt, int $ID )

Send a Trackback.

Description Description

Updates database when sending trackback to prevent duplicates.

Parameters Parameters


(string) (Required) URL to send trackbacks.


(string) (Required) Title of post.


(string) (Required) Excerpt of post.


(int) (Required) Post ID.

Top ↑

Return Return

(int|false|void) Database query from update.

Top ↑

Source Source

File: wp-includes/comment.php

function trackback($trackback_url, $title, $excerpt, $ID) {
	global $wpdb;

	if ( empty($trackback_url) )

	$options = array();
	$options['timeout'] = 10;
	$options['body'] = array(
		'title' => $title,
		'url' => get_permalink($ID),
		'blog_name' => get_option('blogname'),
		'excerpt' => $excerpt

	$response = wp_safe_remote_post( $trackback_url, $options );

	if ( is_wp_error( $response ) )

	$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET pinged = CONCAT(pinged, '\n', %s) WHERE ID = %d", $trackback_url, $ID) );
	return $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d", $trackback_url, $ID) );

Top ↑

Changelog Changelog

Version Description
0.71 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.