Hello, i customized 404 page by changing this file : /framework/views/global called _content-404.php.
How i can change title “Page not found” in browser tab?![]()
Hello Zvonimir,
Thanks for writing in!
“Page Not Found” is a wordpress default not found page title. If you want to override this, assuming that the child theme is set up, please add the following code in your child theme’s functions.php file
function custom_404_title($title){
// If it's a 404 page
if ( is_404() ) {
$title = __( 'Page have been deleted' );
}
return $title;
}
add_filter('pre_get_document_title', 'custom_404_title', 10, 2);
Codex Reference: https://developer.wordpress.org/reference/hooks/pre_get_document_title/
Please note that custom coding is outside the scope of our support. Issues that might arise from the use of custom code and further enhancements should be directed to a third party developer.
Best Regards.
1 Like
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.