Once the plugin is installed, you can access the plugin UI at Settings > Meta Tag Manager. You can install it with from the WordPress admin sidebar with Plugins > Add New, or you can download and install it manually to your wp-content/plugins directory.įinally, activate the plugin in the Plugins section of the admin sidebar. In this section, we’ll see how to add meta tags to your website with the help of the Meta Tag Manager plugin. How to Add Meta Tags With Third-Party Plugins In the next section, we’ll see how you could add meta tags by using third-party plugins. You could add support for other types of pages similarly. Of course, you could go ahead and modify this code as per your needs. Of course, if you're using a different theme, replace twentytwenty_add_meta_tags with the name of your own theme.Īs you can see, we’ve implemented meta tags support for the home page, single post page, and category pages. We’ve then used the wp_head hook to add meta tags to your pages. In the above snippet, we’ve added the twentytwenty_add_meta_tags custom function, which will add meta tags to the different pages of your website. $meta_description = strip_tags ( category_description ()) Īdd_action ( 'wp_head', 'twentytwenty_add_meta_tags' ) $meta_description = substr ( $meta_description, 0, 160 ) $meta_description = str_replace ( array ( " \n ", " \r ", " \t " ), ' ', $meta_description ) $meta_description = strip_shortcodes ( $post -> post_content ) $meta_description = strip_tags ( $post -> post_content ) You can learn how to create a child theme here: However, if you're using a third-party theme like Twenty Twenty, you should create a child theme before you make any changes. If you're using your own custom theme, you can edit the functions.php file directly. To enable meta tags support, we’ll have to add a code snippet in the functions.php file of your active theme. In this section, we’ll discuss how you could enable meta tags support in your WordPress website without any plugins. How to Add Meta Tags to WordPress Without a Plugin In this article, we’ll discuss both ways. Broadly speaking, when it comes to providing meta tags support in WordPress, there are two ways: either you need to edit the WordPress code files or you need to install a third-party plugin. WordPress doesn’t come with built-in support for meta tags, so you need to do a bit of extra work if you want to take advantage of meta tags. There are certain keyword meta tags that don’t contribute to the search engine ranking of your website, although some meta tags like meta description can significantly improve search results. In fact, meta tags allow us to inform crawlers about the specifics of the web pages. When search engine crawlers visit your website, they fetch metadata information in the form of meta tags in addition to fetching the actual content of that page. Meta tags are important when it comes to making your website SEO-friendly. By default, WordPress doesn’t support meta tags, but with a few easy steps you can add support for meta tags in your WordPress website. In this tutorial, I'll show you how to add meta tags to your WordPress website.
0 Comments
Leave a Reply. |