Title: wp_get_update_php_url
Published: February 22, 2019
Last modified: February 24, 2026

---

# wp_get_update_php_url(): string

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wp_get_update_php_url/?output_format=md#description)
 * [Return](https://developer.wordpress.org/reference/functions/wp_get_update_php_url/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_get_update_php_url/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/wp_get_update_php_url/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/wp_get_update_php_url/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_get_update_php_url/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_get_update_php_url/?output_format=md#user-contributed-notes)

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

Gets the URL to learn more about updating the PHP version the site is running on.

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

This URL can be overridden by specifying an environment variable `WP_UPDATE_PHP_URL`
or by using the [‘wp_update_php_url’](https://developer.wordpress.org/reference/hooks/wp_update_php_url/)
filter. Providing an empty string is not allowed and will result in the default 
URL being used. Furthermore the page the URL links to should preferably be localized
in the site language.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_get_update_php_url/?output_format=md#return)󠁿

 string URL to learn more about updating PHP.

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

    ```php
    function wp_get_update_php_url() {
    	$default_url = wp_get_default_update_php_url();

    	$update_url = $default_url;
    	if ( false !== getenv( 'WP_UPDATE_PHP_URL' ) ) {
    		$update_url = getenv( 'WP_UPDATE_PHP_URL' );
    	}

    	/**
    	 * Filters the URL to learn more about updating the PHP version the site is running on.
    	 *
    	 * Providing an empty string is not allowed and will result in the default URL being used. Furthermore
    	 * the page the URL links to should preferably be localized in the site language.
    	 *
    	 * @since 5.1.0
    	 *
    	 * @param string $update_url URL to learn more about updating PHP.
    	 */
    	$update_url = apply_filters( 'wp_update_php_url', $update_url );

    	if ( empty( $update_url ) ) {
    		$update_url = $default_url;
    	}

    	return $update_url;
    }
    ```

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

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/wp_get_update_php_url/?output_format=md#hooks)󠁿

 [apply_filters( ‘wp_update_php_url’, string $update_url )](https://developer.wordpress.org/reference/hooks/wp_update_php_url/)

Filters the URL to learn more about updating the PHP version the site is running
on.

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

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

Gets the default URL to learn more about updating the PHP version the site is running on.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

| Used by | Description | 
| [wp_get_update_php_annotation()](https://developer.wordpress.org/reference/functions/wp_get_update_php_annotation/)`wp-includes/functions.php` |

Returns the default annotation for the web hosting altering the “Update PHP” page URL.

  | 
| [WP_Site_Health::get_test_php_version()](https://developer.wordpress.org/reference/classes/wp_site_health/get_test_php_version/)`wp-admin/includes/class-wp-site-health.php` |

Tests if the supplied PHP version is supported.

  | 
| [validate_plugin_requirements()](https://developer.wordpress.org/reference/functions/validate_plugin_requirements/)`wp-admin/includes/plugin.php` |

Validates the plugin requirements for WordPress version and PHP version.

  | 
| [wp_dashboard_php_nag()](https://developer.wordpress.org/reference/functions/wp_dashboard_php_nag/)`wp-admin/includes/dashboard.php` |

Displays the PHP update nag.

  | 
| [WP_Customize_Theme_Control::content_template()](https://developer.wordpress.org/reference/classes/wp_customize_theme_control/content_template/)`wp-includes/customize/class-wp-customize-theme-control.php` |

Render a JS template for theme display.

  | 
| [customize_themes_print_templates()](https://developer.wordpress.org/reference/functions/customize_themes_print_templates/)`wp-admin/includes/theme.php` |

Prints JS templates for the theme-browsing UI in the Customizer.

  | 
| [WP_Plugins_List_Table::single_row()](https://developer.wordpress.org/reference/classes/wp_plugins_list_table/single_row/)`wp-admin/includes/class-wp-plugins-list-table.php` |  | 
| [wp_plugin_update_row()](https://developer.wordpress.org/reference/functions/wp_plugin_update_row/)`wp-admin/includes/update.php` |

Displays update information for a plugin.

  | 
| [wp_theme_update_row()](https://developer.wordpress.org/reference/functions/wp_theme_update_row/)`wp-admin/includes/update.php` |

Displays update information for a theme.

  | 
| [install_plugin_information()](https://developer.wordpress.org/reference/functions/install_plugin_information/)`wp-admin/includes/plugin-install.php` |

Displays plugin information in dialog box form.

  | 
| [WP_Plugin_Install_List_Table::display_rows()](https://developer.wordpress.org/reference/classes/wp_plugin_install_list_table/display_rows/)`wp-admin/includes/class-wp-plugin-install-list-table.php` |

Generates the list table rows.

  | 
| [update_core()](https://developer.wordpress.org/reference/functions/update_core/)`wp-admin/includes/update-core.php` |

Upgrades the core of WordPress.

  | 
| [list_core_update()](https://developer.wordpress.org/reference/functions/list_core_update/)`wp-admin/update-core.php` |

Lists available core updates.

  | 
| [list_plugin_updates()](https://developer.wordpress.org/reference/functions/list_plugin_updates/)`wp-admin/update-core.php` |

Display the upgrade plugins form.

  | 
| [list_theme_updates()](https://developer.wordpress.org/reference/functions/list_theme_updates/)`wp-admin/update-core.php` |

Display the upgrade themes form.

  |

[Show 10 more](https://developer.wordpress.org/reference/functions/wp_get_update_php_url/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/wp_get_update_php_url/?output_format=md#)

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

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

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_get_update_php_url/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/wp_get_update_php_url/?output_format=md#comment-content-3178)
 2.   [rabmalin](https://profiles.wordpress.org/rabmalin/)  [  7 years ago  ](https://developer.wordpress.org/reference/functions/wp_get_update_php_url/#comment-3178)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_update_php_url%2F%23comment-3178)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_update_php_url%2F%23comment-3178)
 4.     ```php
        // Get PHP update URL.
        $php_update_url = wp_get_update_php_url();
        ```
    
 5. **Output:**
     `https://wordpress.org/support/update-php/`
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_update_php_url%2F%3Freplytocom%3D3178%23feedback-editor-3178)

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