How to set up the ``And` `<meta keywords>` and `<meta description>` tags dynamically set content?<h1></h1> <div class="meta"> <span><a href="https://en.anqicms.com/blog">安企BLOG</a></span> <span>2025-11-06</span> <span>39 Reads</span> </div> <div class="article-body"> <p>As an experienced Anqicms CMS website operator, I know that website SEO optimization is the core work to attract and retain users, and improve the visibility of the website.It is crucial to accurately set the <code><title></code>, <code><meta keywords></code>, and <code><meta description></code> tags (collectively known as TDK, i.e., Title, Description, Keywords) for each page.The Anqi CMS has fully considered SEO-friendliness from the beginning, providing strong and flexible TDK dynamic setting capabilities, allowing operations personnel to easily achieve fine-grained control over page metadata.</p> <h3>Importance of Dynamic TDK Setting in Anqi CMS</h3> <p>In today's internet environment, search engines are the main way users discover content.The page's TDK information directly affects how search engines understand, index, and rank content.A clear, relevant, and attractive title can increase click-through rate, precise keywords help content be retrieved by target users, and an appealing description can effectively enhance the exposure effect of the page.The dynamic TDK setting feature provided by Anqi CMS is designed to ensure that each page can generate metadata that is most compliant with SEO standards and user search habits, thus maximizing the value of the content.</p> <h3>Use AnQi CMS backend to configure TDK information</h3> <p>AnQi CMS backend management system integrates the TDK configuration entry into the content publishing and management process, ensuring the synchronization update of content and metadata.For the <strong>homepage</strong>, operators can directly configure the global title, keywords, and description of the website under the "Background Settings" -> "Homepage TDK Settings".This content is set as the overall metadata basis of the website, and is effective for the homepage and other pages that have not been configured with specific TDK.When creating or editing a <strong>document</strong>, such as an article or product page, AnQi CMS provides fields such as 'SEO Title', 'Document Keywords', and 'Document Description'.Operators can directly enter the exclusive TDK information for this document here.If the "document introduction" is not manually filled in, the system will also intelligently extract the first 150 characters of the document content as the default description, thus alleviating some of the workload for operation personnel.for the &lt;strong&gt;category page&lt;/strong&gt;, such as article category or product category, the editing interface also has fields such as "SEO title", "keywords", and "category description".By configuring a unique TDK for each category, it can better reflect the aggregated topic of the content under the category and improve the search engine performance of the category page.<p></p> <p>Similarly, the <strong>single-page</strong> (such as “About Us”, “Contact Us”) and <strong>label detail page</strong> (such as the document list under a specific label) also provide similar TDK setting options, ensuring that all important content types on the website can have customized metadata.</p> <h3>Call TDK tags dynamically in the template</h3> <p>Safe CMS adopts the Django style template engine, implementing dynamic data rendering through specific template tags.To dynamically display TDK information in the <code><head></code> area of the front-end page, Anqi CMS provides a powerful <strong>universal TDK tag <code>{% tdk %}</code></strong>.This tag can intelligently obtain and output the most relevant TDK data according to the context of the current page (such as a document page, category page, or homepage).<p></p> <p>In the <code>head</code> section of the template file, it is usually used like this:<code>{% tdk %}</code> tag:</p> <pre><code class=\<p> <ul> <li><code>siteName=true</code> property: It can automatically append the website name to the page title.For example, if the page title is "AnQi CMS advantages", and the website name is "AnQi CMS", the final displayed title may be "AnQi CMS advantages - AnQi CMS".This is very beneficial for brand exposure.</li> <li><code>sep</code> Attribute: You can customize the separator between the title and the website name, the default is the hyphen<code>-</code>.For example, the code sep="_" will change the separator to underscore.<li> <li><code>showParent=true</code> Attribute: On category or subcategory pages, you can control whether to display the title of the parent category in the title to provide more complete hierarchical information.<li> <ul> <li> <li><p><strong>Page keywords (<code>meta keywords</code>)</strong>:Use <code>{% tdk with name="Keywords" %}</code> to dynamically insert the keyword list.</p> </li> </ul> </li> </ul>The Anqi CMS will prioritize the use of keywords from the current page's specific configuration, and if none are available, it will intelligently fill in based on the page type.</p><li> <li>Page description (</code>meta description</code>): Insert the page description dynamically using </code>{% tdk with name="Description" %}</code>.This will prioritize calling the page-specific configuration description, otherwise it will use the document introduction, category introduction, or system default description.<p></p><li></li> <li><p><strong>Standard link (code <link rel="canonical">):</strong></p><code>{% tdk canonical with name="CanonicalUrl" %}</code> can get the standard link of the page.</li>Standard links are crucial for avoiding duplicate content issues and concentrating page authority, especially for foreign trade websites.Suggest using the <code>if</code> statement to ensure that the tag is only output when there is a standard link.This dynamic TDK mechanism of Anqi CMS ensures that no matter which page of the website you are on, you can always obtain the most optimized and accurate metadata information for the current content through a consistent tag calling method, greatly enhancing the SEO efficiency and management convenience of the website.</p> <h3>**Practical and Optimization Suggestions</h3> <p>Dynamic setting of TDK is not a one-time solution, continuous optimization is the key to website operation.</p> <p>First, <strong>ensure the uniqueness and relevance of the content</strong>.Each page's title and description should accurately summarize the core content of the page, avoiding general or repetitive expressions.Keywords should match the content closely, avoiding irrelevant or excessive repetition.</p>\n\n<p>Next, <strong>make full use of the TDK inheritance and overriding mechanism of AnQi CMS</strong>.Use the backend to set TDK for the homepage, category, document, single page, and tag pages respectively, which can form a clear metadata hierarchy structure.When the page does not have specific settings, the system will automatically provide default values, but it is still recommended to manually optimize on critical pages to achieve **effect.**</p> <p>Moreover, <strong>focus on user intent and click-through rate</strong>. The title and description are not only for search engines, but also for users.When writing, it should simulate the user's search scenario, so that the user can see the value of the page at a glance, thereby improving the click-through rate.<p> <p>Finally, <strong>regular monitoring and adjustment</strong>.</p>By means of traffic statistics and crawler monitoring tools, analyze the TDK performance of the page.If some pages have low click-through rates or poor rankings, they should be adjusted in time for their TDK content, and A/B testing should be carried out to find a **solution.The "Advanced SEO Tools" and "Traffic Statistics" features of AnQi CMS can provide you with data support.</p> <h3>Common Questions (FAQ)</h3> <p><strong>Q1: Why isn't my page title displaying according to the 'SEO Title' I set?</strong> A1: Please check if the<code><title></code> tag in your template file is correctly used with the<code>{% tdk with name="Title" %}</code> tag.At the same time, confirm that the 'SEO Title' field on this page in the content management backend has been filled in.The TDK tags of AnQi CMS will prioritize reading the SEO settings at the page level, followed by the content title, and finally the global title of the website.If your template uses the <code>siteName=true</code> attribute, the site name will also be appended to the title, which may make you feel that the title is not completely the 'SEO title' you manually entered.<p></p> <p><strong>Q2: What will happen if I have not set a 'Document Summary' or 'Category Summary' for the document or category?A2: If these summary fields are not manually set, Anq CMS will intelligently extract some text from the document content or category content to automatically generate a portion of the page's <code><meta description></code> content.This is typically the first 150 characters or so of the content. Although the system provides automatic filling, we still recommend that you write and optimize these summaries manually to better control the attractiveness of the description and the density of keywords.Q3: Can I set a universal TDK template for a specific content model (such as "product model"), rather than manually filling it out for each product?</strong> A3: The TDK tag design concept of Anqí CMS supports high customization, and it will prioritize reading the most specific TDK configuration of the current page.Although the feature of 'Model-level TDK template' is not provided directly, you can add custom fields (such as 'Product SEO description template') in the content model, and then judge whether these custom fields exist in the template logic. If they exist, they should be used preferentially.Or, by using the category TDK settings under the content model, you can unify the management of TDK for products under the same product category, which can also achieve a similar effect.</p> </div> </div> </div> <div class="layui-card"> <div class="layui-card-body"> <div class="article-prev-next"> <li> Previous: <a href="https://en.anqicms.com/blog/3853.html">How to call the contact information set in the AnQiCMS template from the background?</a> </li> <li> Next: <a href="https://en.anqicms.com/blog/3855.html">How to build a multi-level navigation menu in AnQiCMS template?</a><a></a>\n\n \n \n <li></li>\n </div>\n </div>\n </div>\n </div>\n <div class=\</h5> </a> </li> </li class="item"> <a href="https://en.anqicms.com/blog/10497.html" class="link"> <h5 class="title">How to use the `archive/list` result to view the article details by clicking on `archiveDetail.md`?</h5> </a> </li> </li class="item"> <a href="https://en.anqicms.com/blog/10496.html" class="link"> <h5 class="title">Does the AnQiCMS document list interface support more complex queries for the `extra` field in the returned data?</h5> </a> </li> </li class="item"> <a href="https://en.anqicms.com/blog/10495.html" class="link"> <h5 class="title">How to use the `archive/list` interface to dynamically load more documents on the front-end (infinite scrolling)?</h5> </a> </li> </li> <a href="https://en.anqicms.com/blog/10494.html" class="link"> <h5 class="title">What help do the `canonical_url` and `fixed_link` fields returned by the `archive/list` interface provide for SEO optimization?"</h5> </a> </li> </li class="item"> <a href="https://en.anqicms.com/blog/10493.html" class="link"> <h5 class="title">What will `data` and `total` return if no documents meeting the conditions are found in the AnQiCMS document list??<h5></h5>\n <a></a>\n <li></li>\n \n <ul></ul>\n \n <div></div>\n <div></div>\n <div class=\</h5> </a> </li> <li class="item"> <a href="https://en.anqicms.com/blog/3852.html" class="link"> <h5 class="title">How to obtain and display the website name and Logo in AnQiCMS template?</h5> </a> </li></h5>\n </a>\n </li>\n \n \n <li class=\</h5> </a> </li> </li class="item"> <a href="https://en.anqicms.com/blog/3855.html" class="link"> <h5 class="title">How to build a multi-level navigation menu in AnQiCMS template?</h5> </a> </li> </li> <a href="https://en.anqicms.com/blog/3856.html" class="link"> <h5 class="title">How to generate breadcrumb navigation path in AnQiCMS template?</h5>\n </a>\n </li>\n \n </li class=\</h5> </a> </li> </ul> </div> </div> </div> </div> </div> <div class="footer-block"> <footer class="layui-footer"> <div class="layui-container"> <div class="layui-row layui-col-space30" style="margin-left: -8px;"> margin-right: -8px; row-gap: 16px;"\n \n \<div class="layui-col-lg4 footer-block"\n \n \<h3\>Anqi Content Management System(AnqiCMS)\</h3\n \n \<p\>\n \<img src="/anqicms.png" style="width: 96px;"\n \</p\>\n \</div\>\n \</div\>\n \</div\>\n \</div\>\n</div\>\n\n \n " /></p> <p>AnqiCMS Content Management System, an enterprise-level content management system developed using GoLang, is easy to deploy, secure, elegant in interface, compact, and fast in execution. Websites built with AnqiCMS can prevent many security issues.<p></p>\n <div class=\ al.src = "/api/log?action=views&code=200&id=3854&path=http%3A%2F%2Fwww.anqicms.com%2Fblog%2F3854.html&type=archive&nonce="+Date.now(); document.body.appendChild(al); })(); </script> <script src="https://en.anqicms.com/static/anqitpl1/js/template.js?v=1.3"\u003e\u003c/script\u003e \u003cscript src="https://en.anqicms.com/static/anqitpl1/layui/layui.js"\u003e\u003c/script\u003e \u003cscript type="module"\u003e import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs'; mermaid.initialize({ startOnLoad: true }); </script> <script> layui.config({ base: "https://en.anqicms.com/static/anqitpl1/js/" }).use(['index','pjax']); //Loading entry </script> <script src="https://en.anqicms.com/static/anqitpl1/js/app.js?v=1.5.7></script> <div class="layui-hide"><script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?23ac1576d1ee72920a3d65a2cf536ac0"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s);)})) <sc ript> </div> </html>