How do I define an entry's META description? I'd really like some help with Craft CMS, that's probably a very basic thing to achieve, but I've so far got no idea how to. In another post about SEO, I saw something like this written:

&lt;meta name="title" content="{% if title is defined %}{{ title }}{% endif %}"&gt;
&lt;meta name="description" content="{% if description is defined %}{{ description }}{% endif %}"&gt;


The first part, regarding the title, is in the _layout.html by default. And, in the CMS, above each entry's body, I have managed to display a box for the user to enter a title.

BUT, were I to add the second part, regarding the description, I have so far been unable to find out how in the CMS, I can add a box for the user to enter a description.

Thanks in advance for any help that anyone can provide.

With kind regards,

Mark
The Title field will be a part of every entry 90% of the time ('Singles' don't need a Title).

To add a custom field in Craft:
Settings > Fields > (create a field)

To add the new field to a content type:
Settings > Sections > (click the "Edit content-type" link to the right) > (drag your new field into the blue box) > hit Save.



I like to create a separate custom field for each e.g. "Meta Title" and "Meta Description" - I then add these to a separate tab within a given content-type. (see attached)



Normally, I leave the SEO fields optional.

Then, in _layout.html:

&lt;title&gt;{% block entryMetaTitle %}{% endblock %}{{ siteName }}&lt;/title&gt;
&lt;meta name="description" content="{% block entryMetaDescription %}{% endblock %}"&gt;


The block tags inherit content from an individual template e.g. domain.com/news/news-article-slug, will make use of a single-entry template e.g. craft/templates/news/_entry.html which will contain:

{% extends "_layouts/_layout" %}

{% block entryMetaTitle %}{% if entry.metaTitle %}{{ entry.metaTitle}} | {% elseif entry.title %}{{ entry.title}} | {% endif %} News | {% endblock %}
{% block entryMetaDescription %}{% if entry.metaDescription %}{{ entry.metaDescription}}{% else %}{{entry.summaryText}}{% endif %}{% endblock %}

{% block content %}
... 
{% endblock %}


The above will display any content which the client decides to add to the custom fields, OR if nothing has been added the template will display the entry Title + Summary Text (in this case)

This post might also help you to define your own approach: How do you handle SEO on your site?