How to Add Meta Tags in WordPress Without a Plugin?
Meta tags play a crucial role in SEO by providing search engines with important information about your site's content. They help improve your site's visibility and ensure that the right audience finds your content. While plugins like Yoast SEO or All in One SEO are popular for managing meta tags, you can also add them manually without a plugin. This article will guide you through the process of add meta tags in WordPress without relying on any plugins.
Understanding Meta Tags
Meta tags are snippets of text that describe a page's content. They don't appear on the page itself but only in the page's code. Common meta tags include:
- Title Tag: Defines the title of the webpage.
- Meta Description: Provides a brief description of the page content.
- Meta Keywords: A set of keywords relevant to the page content (less used today by search engines).
- Viewport: Ensures proper scaling of the webpage on different devices.
- Charset: Specifies the character encoding for the HTML document.
Steps to Add Meta Tags Manually
- Access the Theme Editor:
- Go to your WordPress dashboard.
- Navigate to
Appearance>Theme Editor. - In the theme files list on the right, find and click on
header.php. This file controls the head section of your website.
- Edit the Header File:
- Before making any changes, it's a good practice to back up your current
header.phpfile. - Locate the
</head>tag within theheader.phpfile. You will add your meta tags just before this closing tag.
- Before making any changes, it's a good practice to back up your current
- Add Your Meta Tags:
-
Insert your meta tags just before the
</head>tag. Here?s an example of how to add a title, description, and viewport meta tag:<meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="Your page description here"> <meta name="keywords" content="keyword1, keyword2, keyword3"> <title>Your Page Title</title>
-
News & Blog