How to Add Custom Meta Tags on WordPress 404 Page

How to Add Custom Meta Tags on WordPress 404 Page

To add custom meta tags on wordpress 404 page, copy the following code and paste it above the meta tags in header.php of your theme.

<?php if(is_404()): ?>
<title>Manpreet.im 404 Page </title>
<meta name="description" content="This is a description for 404 page on Manpreet's blog">
<?php endif; ?>

For WPML





<?php if(ICL_LANGUAGE_CODE=='en'): ?>
		<?php if(is_404()): ?>
			<title>Manpreet.im English</title>
			<meta name="description" content="English Description">
		<?php endif; ?>
	<?php elseif(ICL_LANGUAGE_CODE=='fr'): ?>
		<?php if(is_404()): ?>
			<title>Manpreet.im French</title>
			<meta name="description" content="Description in french">
		<?php endif; ?>
	<?php endif; ?>

No Comments

Leave a Reply