Textpattern section based SEO
Site expired so here is the content:-
Textpattern section based SEO
by Ralph ‘Deimossystems.com’
“Probably everyone who knows how to approach to SEO should be aware that each page suppose to a have different Meta title, keyword and description (optional) for every singe page.
By default txp uses site name from admin – > preferences – > basic, obviously this won’t give us a good position in google ranking.
It’s well known that each txp section should have different title, keywords and description. Page that display an individual article should have a seperate meta tags as well.
Before we start I have to make clear one basic thing in textpattern.
What is individual article in txp?
The individual article in the one that uses article title as the URL address. We can get there by creating pernament link from your article list. We check is current article individual by using:
<txp:if_individual_article>
<txp:else />
</txp:if_individual_article>
Now after you know what an individual article is, I would like to show you my way improve your seach engine optimalization in textpattern.
To start, we have to create two forms which you can do in Presentation – > Forms
First form will consist conditionals statemants which meta tags should be used for a different section and what to do when page displays an individual article.
1) Please create a new form called: Meta_tags.
Paste following code into your form content:
<txp:if_individual_article>
<txp:output_form form="Meta_Form" />
<txp:else />
<txp:if_section name="">
<title>Your page title</title>
<meta name="keywords" content="your keywords, seperated by comma" />
<meta name="description" content="description here" />
</txp:if_section>
<txp:if_section name="section name 1">
<title>Your page title</title>
<meta name="keywords" content="your keywords, seperated by comma" />
<meta name="description" content="description here" />
</txp:if_section
<txp:if_section name="section name 2">
<title>Your page title</title>
<meta name="keywords" content="your keywords, seperated by comma" />
<meta name="description" content="description here" />
</txp:if_section>
</txp:if_individual_article>
2) Create new form called : Meta_Form
Paste following code into your form content:
<title><txp:custom_field name="title" /></title>
<meta name="description" content="<txp:custom_field name="description" />" />
<meta name="meta_keywords" content="<txp:custom_field name="keywords" />" />
3) Copy this line into the
<txp:output_form form="Meta_tags" />
don’t forget to remove old meta tags (title ,keyword, description).
The job is done
Now let me explain how it works
Meta_Form – to use article custom fields to show meta tags for individual articles
Meta_tags – the main form that contains all conditional statements, each statements has meta tags for a different section
You can customize section meta tags by editing conditional statements in the Meta_tags form.
Each “if statement” takes section name as an argument and it should be left empty for the home page.
To adjust meta tags for an individual article you have to fill in custom fields (which you can find under advanced options on the left side of content box) as follows:
Title – custom1
Description – custom2
Keywords – article keywords
There is no need to fill in article custom fields for articles that will not be showed as an individual article”.