arc_meta

Meta tag plugin for improving your site’s SEO and getting more out of social marketing.

Usage

All of the following tags should be used within your templates’ <head> tag.

arc_meta_title

Outputs an SEO friendly <title> tag.

<txp:arc_meta_title />

Attributes

The arc_meta_title tag attributes override the defaults. To set the default patterns used for the <title> tag goto the plugin’s options page.

  • title — use this to override the title tag’s content
  • article_title — sets the pattern for article page titles
  • comment_title — sets the pattern for comment page titles
  • search_title — sets the pattern for search results page titles
  • category_title — sets the pattern for category page titles
  • section_title — sets the pattern for section page titles
  • homepage_title — sets the pattern for the homepage title

Title Tokens

To set a pattern for a page title you can use the following tokens:-

  • %a — article title, can only be used on article and comment pages
  • %s — section name, can be used on article and section pages
  • %c — category name, can be used on category pages (not including filtered section pages)
  • %n — site’s name, can be used on all pages
  • %t — site’s slogan, can be used on all pages
  • %q — search query, can be used on search results page

For example, you could define the pattern for an article page as:-

%a | %n (%t)

This would output something like:-

<title>Welcome to Your Site! | My site (My pithy slogan)</title>

Examples

Example Using the section_title Attribute
<txp:arc_meta_title section_title='%n / %s' />

Outputs on an ‘Articles’ section page:-

<title>My site / Articles</title>
Example Using the title Attribute
<txp:arc_meta_title title='Hello World' />

Outputs:-

<title>Hello World</title>

arc_meta_description

Outputs a meta description tag when a description has been set.

<txp:arc_meta_description />

Attributes

  • description — overrides the description set using arc_meta’s description field on the article Write page or section/category edit page

arc_meta_robots

Outputs a meta robots tag when robots have been set. When a site is in testing or debugging mode it will automatically output a ‘noindex, nofollow’ tag with the your actual setting as a comment immediately after the tag for reference.

<txp:arc_meta_robots />

Attributes

  • robots — overrides the robots instructions set using the meta robots field on the article Write page or section/category edit page

arc_meta_keywords

Outputs a meta keywords tag when keywords have been set (only works for articles).

<txp:arc_meta_keywords />

Attributes

  • keywords — overrides the keywords set using the meta keywords field on the article Write page

arc_meta_canonical

Specify the page’s canonical URL. See Google’s Specify Your Canonical for an explanation.

<txp:arc_meta_canonical />

Attributes

  • url — overrides the default URL

arc_meta_open_graph

Outputs meta tags for using Facebook Open Graph.

<txp:arc_meta_open_graph />

Just including the above tag in your templates’ <head> tag will output tags for the following:-

  • og:site_name — your site name from your preferences
  • og:title — the article’s title, section name or category name
  • og:description — your page’s meta description
  • og:url — your page’s canonical URL
  • og:image — the article’s image

You can override the default values of any of these by passing a value to one of the tag’s attributes defined below. To disable one of the tags just pass an empty attribute value (e.g. title='').

Attributes

  • site_name
  • title
  • description
  • url
  • image

arc_meta_twitter_card

Outputs meta tags for using Twitter Cards.

<txp:arc_meta_open_graph />

Just including the above tag in your templates’ <head> tag will output tags for the following:-

  • twitter:card — ‘summary’ by default, can also be set to ‘photo’ for image content or ‘player’ for videos
  • twitter:title — the article’s title, section name or category name
  • twitter:description — your page’s meta description
  • twitter:url — your page’s canonical URL
  • twitter:image — the article’s image

You can override the default values of any of these by passing a value to one of the tag’s attributes defined below. To disable one of the tags just pass an empty attribute value (e.g. title='').

Attributes

  • card
  • title
  • description
  • url
  • image

Admin

Article Write Page

The plugin will add title and description fields to the Meta options. Use these to set your article’s meta data.

If you set a title here it will be used in place of the article’s title when replacing the %a token for the arc_meta_title tag.

The description will be used for the arc_meta_description tag and for the descriptions used by the arc_meta_open_graph and arc_meta_twitter_card tags.

Section and Category Pages

The plugin will add meta title and meta description fields to the section and category edit forms.

If you set a title here it will be used in place of the section’s/category’s name when replacing the %s/%c token for the arc_meta_title tag. When editing the homepage section the meta title will replace any pattern defined for the page title.

The description will be used for the arc_meta_description tag and for the descriptions used by the arc_meta_open_graph and arc_meta_twitter_card tags.

Plugin Options

From the plugin’s options page you can set the default patterns used for the arc_meta_title tag. These can all be overridden when the tag is included in your page templates, but it may be easier to set the default patterns if you want to change the ones that come with the plugin when installed.

The Details


Comments

  1. Alexander |

    Hi Andy,
    I just found this plugin and played around with it. All I can say is: GREAT WORK! It saves me a lot of time and custom code in pages and forms and fits perfectly into my needs on this topic.

    It’s just an idea but what about adding a “meta robots” tag as well. Sometimes you don’t want search engines to index an article or section. A “meta robots” tag be a dropdown containing the following options:

    index, follow (default)
    index,nofollow
    noindex, follow
    noindex, nofollow

  2. Andy |

    The plugin now supports robot meta tags.

  3. Alexander |

    Just updated the plugin on some pages and will play around with it. So far it looks really really good. Just perfect. Thank you!

  4. Viking KARWUR |

    Hi Andy, thanks! Awesome #textpattern plugin! Will use in my web.

  5. David Andor |

    Hi – I think this should be wrapped up as part of TXP core. I was coding my own solution to section pages (used a lot for full sticky articles hence need keywords and description meta), but this is much more graceful. Thanks!

  6. Steven |

    Hi,

    great plugin. Was only wondering why you use single quotes instead of double quotes around the meta information which i always use?
    thanks.

  7. Andy |

    @Steven I’m surprised how many people have commented on the plugin’s use of single quotes when they are completely acceptable syntax for HTML. I’ve used them purely for the way the PHP code has been written to make things simpler. However, seeing as I’ve had several people comment that they’d prefer double quotes I’ll change this in the next release of the plugin.

  8. Dale Chapman |

    Hi,

    Nice Plugin. I need to use %c | %s in category pages. Why is this not permitted.

  9. Dale Chapman |

    I need to use %c | %s for titles on category pages… Your plugin does not allow for this currently… help?

  10. Andy |

    Hi Dale,

    You’re right, arc_meta_title currently doesn’t support “%c | %s”. This was partly due to the way Textpattern handles categories. I will take a look and see if I can extend it to work the way you need when I get a free moment.

  11. Tobias |

    Hi Andy,

    just played around with your awesome arc_meta again plugin and found out that “meta description” can’t contain more than 153 characters and “meta title” not more than 63 characters. Is this a “feature” or a limitation on the database or txp side?

    Regards,
    Tobias

  12. Andy |

    Hi Tobias,

    These restrictions were built in as a feature. The character limits were based on limits applied by search engines using this meta data so as to dissuade users from writing more than would be accepted as it would otherwise defeat the point of using the meta tags for SEO.

    There is no restriction as far as Textpattern is concerned.

  13. Tobias |

    Hi Andy.

    Thank you for your feedback.

    More characters wouldn’t necessarily defeat the use of meta tags as they were used by directories or other sites as well and not only by search engines. So what about a customizable character limit or a kind of a counter (x of 155 suggested characters) or even a true limitation? Always better than incomplete text snippets that makes the meta tags look quite untended.

  14. Sviatoslay |

    Hi Andy. Can u help me please? I try use your great plugin, and put into page template within <head> tags (for example) this: <txp:arc_meta_title title=‘Hello World’ /> .But nothing happens. I use txp 4.2.0 version. Maybe trouble in version or i do something wrong. Thanks.

  15. Andy |

    Hi Sviatoslay,

    arc_meta should work fine with 4.2 as far as I am aware. Is the plugin enabled? If you switch to ‘debugging’ mode in the site preferences do you get any error messages?

  16. Sviatoslay |

    Hi Andy. Thank you for your feedback. Plugin enabled. But when I switch debugging mode I see many errors on site. I think that the problem here. Many thanks for your help.

  17. Brendan |

    Hi Andy!

    I’m having trouble getting this to work (Its gotta be something i’m doing wrong). The plugin is active and I have put <txp:arc_meta_description /> in the header. The Meta Title, Meta Description & Meta Robots boxes are now appearing in the edit sections menu. I have added text into these fields but I’m not getting any meta data appearing in the header when I check the source code. Can you please help? I’m using Txp v4.5.7. Thanks!

  18. Andy |

    Hi Brendan,

    A couple of things. Is the meta data definitely saving? The article meta tags only show on an individual article template, if you are trying this with a section page (perhaps with a single article) you need to make use of the section meta data.

  19. Chris |

    Hi,

    This plugin looks great, but I’m having a bit of trouble getting it working. I have installed the plugin ok and it’s active, but if I enter a title and description in the boxes on the articles and press save they aren’t saved, the boxes are blank again. Any ideas?

    Chris

  20. Andy |

    Hi Chris, have you checked that the arc_meta table has been created in the database? What version of Textpattern are you using?

  21. Scott |

    Just want to thank you for excellent plugin. I had same error as above once I upgraded txp and reinstalled plugin all is well.

  22. Andrey |

    Hi!
    I am grateful for this excellent module. But I changed it slightly.
    In particular I added the token %p which can output the page number in arc_meta_title. This is convenient for pagination.
    Maybe it makes sense to add it in future versions?
    Code

  23. Andy |

    @Andrey thanks.

    Please feel free to directly contribute your page token update to the plugin by making a pull request to its GitHub repository.

  24. James Martin |

    Is there some way I can use the excerpt as the og:description? I’ve tried everything I know and some things I don’t.

  25. Andy |

    Hi James, it should already fallback on the excerpt if a meta description hasn’t been set.

    You can also set the description used by arc_meta_open_graph like this:-

    <txp:arc_meta_open_graph description="<txp:excerpt />" />

Leave a Comment
  • You will need to preview your comment before you can submit it.