No child themes. No heavy plugins. No file hacks that vanish on updates. Just your own lightweight WordPress plugin to add a global meta description tag.
- Connect to your WordPress hosting server via FTP.
- Create a new folder:
wp-content/plugins/mymetadescription - Inside that folder, create a file:
mymetadescription.php
Add the code provided below into this file. - Activate your plugin in the WordPress Admin Dashboard.
<?php
/*
Plugin Name: MyMetaDescription
Description: Adds a global meta description to the header.
Version: 1.0
Author: YourName
*/
function add_meta_description() {
echo '<meta name="description" content="Enter your blog description here." />' . "\n";
}
add_action('wp_head', 'add_meta_description');
To verify it works, reload a page on your blog, view the page source, and search for:
<meta name="description"
Leave a Reply