Title: trackback_response
Published: April 25, 2014
Last modified: February 24, 2026

---

# trackback_response( int|bool $error, string $error_message )

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/trackback_response/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/functions/trackback_response/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/trackback_response/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/trackback_response/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/trackback_response/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/trackback_response/?output_format=md#wp--skip-link--target)

Response to a trackback.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/trackback_response/?output_format=md#description)󠁿

Responds with an error or success XML message.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/trackback_response/?output_format=md#parameters)󠁿

 `$error`int|boolrequired

Whether there was an error.
 Default `'0'`. Accepts `'0'` or `'1'`, true or false.

`$error_message`stringrequired

Error message if an error occurred. Default empty string.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/trackback_response/?output_format=md#source)󠁿

    ```php
    function trackback_response( $error = 0, $error_message = '' ) {
    	header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ) );

    	if ( $error ) {
    		echo '<?xml version="1.0" encoding="utf-8"?' . ">\n";
    		echo "<response>\n";
    		echo "<error>1</error>\n";
    		echo "<message>$error_message</message>\n";
    		echo '</response>';
    		die();
    	} else {
    		echo '<?xml version="1.0" encoding="utf-8"?' . ">\n";
    		echo "<response>\n";
    		echo "<error>0</error>\n";
    		echo '</response>';
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-trackback.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-trackback.php#L30)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-trackback.php#L30-L46)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/trackback_response/?output_format=md#related)󠁿

| Uses | Description | 
| [get_option()](https://developer.wordpress.org/reference/functions/get_option/)`wp-includes/option.php` |

Retrieves an option value based on an option name.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/trackback_response/?output_format=md#changelog)󠁿

| Version | Description | 
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Ftrackback_response%2F)
before being able to contribute a note or feedback.