Sarathlal N

Add meta description on Anchor CMS default theme

In Anchor CMS default themes (version 0.9.2), it show the site description as a meta description for all pages & posts. Basically, the developers of Anchor CMS don’t like to consider such SEO matters.

If Google realize that our meta description is not good for our content, it will show some random lines of text related with our content in our web pages as a search description!

But if you are a SEO buddy, you have option to deliver unique meta description for Anchor CMS. With this code snippet, we use post description as a content for meta description tag. That means, our post / page description will appear as search description in Search Engine result Pages.

Currently, Anchor CMS don’t support plugins & child themes (version 0.9.2). So now we try to edit our theme files.

</ul>

<?php if(is_article()): ?>
	<title><?php echo article_title(); ?> | <?php echo site_name(); ?></title>
	<meta name="description" content="<?php echo article_description(); ?>">
<?php elseif(is_homepage()): ?>
	<title><?php echo site_name(); ?> | <?php echo site_description(); ?></title>
	<meta name="description" content="<?php echo site_description(); ?>">
<?php elseif(is_page()): ?>
	<title><?php echo page_title(); ?> | <?php echo site_name(); ?></title>
	<meta name="description" content="<?php echo site_description(); ?>">  
<?php endif; ?>

Looking for a skilled WordPress/WooCommerce developer? I'm currently available for freelance, contract, or full-time remote opportunities! Let's create something amazing together. Send me a quick message, and I'll respond within 24 hours!

Recent Posts

  1. Automating Code Linting with GitHub Actions for WordPress Plugins
  2. Comprehensive Guide to Linting PHP, JavaScript, and CSS in WordPress Plugins Using Composer
  3. The Ultimate Guide to Indexing in Database Design
  4. Understanding 'update_meta_cache' in WordPress - When to Use It, When Not to, and Its Impact on Database Queries
  5. A Guide to Configuring JavaScript and SCSS Paths in WordPress Plugins with @wordpress/scripts

Your Questions / Comments

If you found this article interesting, found errors, or just want to discuss about it, please get in touch.