A
A
Abram3332021-07-27 12:55:59
WordPress
Abram333, 2021-07-27 12:55:59

How to add the necessary meta tag manually to the 404 page?

Good day to all!
Please tell me how can I insert the necessary meta tag on a 404 page?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor Danchenko, 2021-07-27
@Abram333

functions.php

add_action(
    'wp_head',
    function() {
        if ( is_404() ) {
            // Ваш мета тег
            echo '<meta name="robots" content="noindex, nofollow">';
        }
    }
);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question