@kyleigh.wolff
Adding meta tags in ExpressionEngine can be done by editing your template files. Here’s a step-by-step guide to help you add meta tags:
Add the meta tags to your HTML <head>
section within the chosen template. Here's a basic structure for adding meta tags:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>{embed="{segment_1}"}Default Title{/embed}</title> <!-- Meta tags --> <meta name="description" content="{embed="{segment_1}"}Default Description{/embed}"> <meta name="keywords" content="ExpressionEngine, CMS, Meta Tags"> <meta name="author" content="Your Name or Company"> <!-- Custom Field Data (if applicable) --> <meta property="og:title" content="{custom_field_title}"> <meta property="og:description" content="{custom_field_description}"> <!-- Additional Meta Tags --> <!-- Add any additional meta tags as needed --> </head> <body> <!-- Page content --> </body> </html> |
If you’re using dynamic content, you can pull data from custom fields, channels, or other content sources. For example, if you have a channel field for a page’s description, you can do this:
1
|
<meta name="description" content="{your_description_field}"> |
You can also use conditionals to determine what meta tags to display based on particular criteria. For example:
1 2 3 4 5 |
{if segment_2 == ""} <meta name="description" content="Default description for the homepage"> {if:else} <meta name="description" content="{your_description_field}"> {/if} |
After you have added the necessary meta tags and ExpressionEngine variables to your template, save the changes:
By following these steps, you should be able to integrate meta tags into your ExpressionEngine templates effectively.