Jump to content

Processwire And Seo


Philipp
 Share

Recommended Posts

1) Introduction
A great ProcessWire site is useless without visitors. If the site lacks of direct traffic, the webmaster has to rely on search engine users clicking on the right result. The goal is a good position on the result pages of special keywords. Optimizing sites for search engines, mostly Google, is called Search Engine Optimization (SEO). You will find many of techniques, methods and ideas on the internet. The topic is widely discussed and new ways of SEO arrive every day.
 
This tutorial covers the technical aspect for SEO with the ProcessWire CMS and should give you a general overview on the topic.
 
 
2) Why ProcessWire fits perfectly to your SEO strategy
With ProcessWire, nearly all practices for SEO can be used. It might be one of the best CMS in this field. Let us explain these   bold claims.
 
Every SEO aspect is related to the content on your page. It can be some meta tags in the HTML-Head or how you structure your headings. Even microformats are just another way of how markup is presented to the visitor (or the search engine bot). After all, it's the logic on how we generate the HTML that we try to optimize. Where to put the content, how to define a site description or how URLs are made up. Most SEO modules for common CMS like WordPress or Drupal are generating the right markup.
 
ProcessWire is a little bit different. As you might know, there is no pre-defined markup. Every line of front-end HTML code can be written by the programmer. As a result, there is no limit on how we can structure the HTML. You want those new fancy HEAD Attributes? No problem. Grab the first image of a gallery and define it as the meta og:image? Easy job, even if you need a special resolution for Facebook and a smaller one for Twitter.
 
So, what do we have to do? We can't just simply install a one-click "SEO module". We have to define, which fields will represent which HTML attribute or how we wrap the content into microformat schemas. Ask yourself the following questions:
  • Which values(keywords,descriptions,information) do I need for my SEO strategy?
  • Are those values stored per page, for a section of your site or can they be defined for the whole site?
  • Should the user/administrator enter those values or can they be combined/calculated based on other fields?
  • What happens if there is no value defined for a field? How does the fallback look like?
 
Beside that, some good practices for SEO are already implemented by ProcessWire. The URL structure representing the page tree is clean and you can even customize it to fit to your requirements.  Unique URLs are standard. With modules like ProCache, MinimizePW or AIOM you can optimize page speed quick. Everything else, expect the server performance is part of the undefined HTML markup.
 
3) Example on how to integrate meta tags (or anything you like)
We want to have some keywords and a (short) description in our HTML Head. So we create two fields, calling them e.g. keywords and description and add them to a template. Create a page with that template and enter some keywords and a description.
In your template file output the fields in the HTML head:
<meta name="description" content="<? echo $page->description ;?>"/>

That's all. We can now extend this to have fallback or choose the fields with a more advanced logic. Nico explains this for example in his blog post.

 
Extra hint: If we want to fallback on the (mandatory) title field of a page, we can use the ->get Method.
<meta name="description" content="<? echo $page->get('description|title');?>"/>

This will use the title field in case the description field is empty. You could use this to provide the user an option to "override" the SEO logic by manually entering the values.

 
Another example would be the alt-tag for images.
To provide an alt-tag for an image, we use the description field of the image field. In this example, we take the first image from the field "images" on the page.
<img src="<? echo $page->images->first()->url ;?>" alt="<? echo $page->images->first()->description;?>"/>

The description attribute is part of every PageImage field. You could hide it from the backend but it's visible by default.

 
4) Modules for SEO
This module will generate a sitemap.xml that can be crawled and used by search engines. The basic setup just generates a sitemap.xml with every page included. You can finetune the settings if you want.
 
This module sets microformats for content in TextAreas/WYSIWYG areas. It will wrap basic content into the right schema.org schema. The module page provides further information
 
Moving a page to another URL? With this module you don't have to worry about visitors getting an 404 error. It will try to track changes in the URL of pages and redirect visitors to the new location - as long as there isn't a new page with the URL.
 
Sometimes you want to have some entry-pages for special keywords. If you need a special domainname for those site, you can setup the Multisite module. 
 
5) Further links and tutorials
 
 
6) Conclusion
 
Maybe this little tutorials helps starters to get an idea, on how to optimize their page for search engines. This might seem little bit more difficult then just to install a one-click solution. But if you put in an hour to just think about a clean and readable markup with all tags, you will get great results.
 
Any additions or practices are welcome. I will try to answer any questions in this thread and make the tutorial better over time.
  • Like 24
Link to comment
Share on other sites

This is great, Philipp -- thanks! I'm tempted to forward this to a few co-workers right away :)

Two minor additions you might want to consider: a note about inserting images within RTE (mainly from alt tags point of view, but also that PW automagically resizes images, which in turn reduces unnecessary load) and Redirects module.

Link to comment
Share on other sites

On a roll what a great topic! I would love to see this expanded into other areas as well. I am still trying to grasp the concepts behind seo. Is there any plan for a seo type cheatsheet? Like how to form titles and meta tags, img, links and such?

Link to comment
Share on other sites

On a roll what a great topic! I would love to see this expanded into other areas as well. I am still trying to grasp the concepts behind seo. Is there any plan for a seo type cheatsheet? Like how to form titles and meta tags, img, links and such?

A SEO 'cheatsheet' would never be limited to PW. The same rules apply to more or less everyone. Just put your title and description meta tags in good shape and make well formed and to the point (html) content and you should be fine. Take care of heading levels and such and do not ever underestimate the power of Google and the like. Most of times it is some kind of specificity and traffic kind of magic. For further SEO tips and tricks there's plenty to go around if you just Google.

No amount of trickery (apart from maybe sponsored ads ;) ) will get you on top op of Google for example 'harry potter books', unless you're  Wikipedia, Amazon or author sites.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Thank you, seo is just such an in depth topic that I understand little about. I Just worry that I will finish the site and no matter what I do my site will still not show up on google. I thought there may be some sort of insider tricks to make managing processwires structure to be more seo friendly :)   

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...