### [How to Change the Page Title on the Browser Tab](https://wpforms.com/developers/how-to-change-the-page-title-on-the-browser-tab/)

**Published:** March 11, 2020
**Author:** Editorial Team

**Excerpt:** This article will walk you through how to change the page title that appears on the browser tab using a small PHP snippet. 

**Content:**

## Overview

Would you like to change the page title of the browser tab? This is very easy to do with a small snippet of code. We’ll show you the PHP needed to change this title.

## Setup

By default, when viewing any page, the page title that displays in the browser tab is pulled from page or post title. This is also true when using the **Conversational Forms** addon or the **Form Pages** addon, the title that appears is the title of the form you have defined in your form settings.

In some cases, you may wish to make the browser tab title different to the actual name that displays when you load the form. To change this title, [copy this code snippet to your site](https://wpforms.com/developers/how-to-add-custom-php-or-javascript-for-wpforms/ "How to Add Custom PHP or JavaScript for WPForms").

```

/**
 * Change the page title on the browser tab.
 * 
 * @link https://wpforms.com/developers/how-to-change-the-page-title-on-the-browser-tab/
 *
 */

function generate_custom_title( $title ) {

        // Enter the ID number of the page you want to change here
	if ( is_single( '850' ) ) {
		$title = __( 'My Custom Title', 'textdomain' );
	}
	
	return $title;  
}
add_filter( 'pre_get_document_title', 'generate_custom_title', 10, 1 );
```

In the code shown above, the page ID we’re targeting is `850`. You’ll need to change this ID number to match your page ID. To find out this number, [please check out this helpful documentation](https://www.wpbeginner.com/beginners-guide/how-to-find-post-category-tag-comments-or-user-id-in-wordpress/ "How to Find Post, Category, Tag, Comments, or User ID in WordPress").

When using this snippet for the **Conversational or Form Pages addon**, the ID number you’ll need to enter in the snippet is the form ID. to find your form ID, [please check out this tutorial](https://wpforms.com/developers/how-to-locate-form-id-and-field-id/ "How to Locate Form ID and Field ID").

And that’s it! You’ve successfully changed the title of the browser tab shown on **Conversational Forms**. Would you like to also change the required field indicator on WPForms? Check out our tutorial on [How to Change Required Field Indicator](https://wpforms.com/developers/how-to-change-required-field-indicator/ "How to Change Required Field Indicator").

## Related

Filter Reference: [pre\_get\_document\_title](https://developer.wordpress.org/reference/hooks/pre_get_document_title/ "Using WordPress pre_get_document_title filter")

**Categories:** Snippets

**Tags:** PHP

---

