404 page – unable to remove default page title

  • Hi,

    I’m trying to fully customize the 404 page in GeneratePress, but I’m running into an issue where the default page title is still being displayed.

    I am currently using the following code snippet added to my child theme functions.php (based on this forum topic: https://generatepress.com/forums/topic/remove-search-from-404-page/):

    add_filter( 'generate_404_text','generate_custom_404_text' );
    function generate_custom_404_text()
    {
        return '';
    }
    add_filter( 'get_search_form','my_remove_search_form' );
    function my_remove_search_form()
    {
        $template = $GLOBALS['template'];
        $template_file = substr($template, strrpos($template, '/') + 1);
        if ($template_file === '404.php') {
            return '';
        }
    }

    This removes the 404 text and the search form as expected.

    However, the default page title is still visible on the frontend:

    “Die pagina kan niet worden gevonden.”

    I also followed the steps described here:
    https://generatepress.com/forums/topic/404-page-3/

    But I am still unable to remove the page title completely.

    Could you please advise what the recommended or correct way is to fully disable the 404 page title in GeneratePress when using a custom 404 layout?

    Thank you in advance for your help.

  • Hi there,

    I checked your site’s 404 page, and it does not look like you’ve set the element type to content template as instructed here https://generatepress.com/forums/topic/404-page-3/#post-2247192.

    Can you make sure the block element’s element type is set to content template?

  • Perfect! This solved everything. Thank you.

  • No Problem 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.