Hot answers tagged

34 votes

How do you handle SEO on your site?

Without having to use a separate Plugin this is a good basic practice on setting up basic SEO for your site. First create three new fields called "seoTitle", "seoDescription" and "seoKeywords". Put ...
user avatar
  • 2,824
17 votes
Accepted

How do you handle SEO on your site?

You basically have two options... In the world of plugins, check out the SEOmatic plugin or Sprout SEO plugin. On Craft 2, SEOmatic is free, Sprout SEO is $99. On Craft CMS 3, the SEOmatic plugin ...
user avatar
  • 23.6k
15 votes
Accepted

Approaching Google AMP

You're asking kind of a loaded question but as far as Craft is concerned, you're in a good position to spit out exactly what you need as far as markup and styles go. AMP is more or less just a small ...
user avatar
  • 6,467
14 votes

How do you handle SEO on your site?

Completely biased answer, but check out my SEOmatic plugin. It's pretty comprehensive, and it's free. If you're running Craft CMS 3, the SEOmatic plugin is available for Craft CMS 3 as well (but is ...
user avatar
8 votes
Accepted

Does Craft CMS support these features?

Preview function for different devices, screen sizes and screen configurations(portrait/landscape) Yes it has live preview. However this isn't per device. You can open the entry with a secret url ...
user avatar
  • 1,907
5 votes

Change posts url without losing SEO positioning

Migrating Redirects should not be thought of as a one-time event but a process that includes a step where you make sure Redirects are in place and working. A rough redirect strategy Take a snapshot ...
user avatar
  • 13.2k
5 votes
Accepted

SEO titles/descriptions for tags and archive pages

The better approach in my opinion is to declare the variables in the corresponding templates rather than in the _layout template Layout.twig {% if seoTitle is not defined or seoTitle is empty %} ...
user avatar
4 votes
Accepted

Old Posts Not Appearing in XML Sitemap

Default limit is 100, try adding .limit(null) to the query
user avatar
  • 1,332
4 votes

File robots.txt needed in Craft package?

The specific directive to disallow the /craft/ directory isn't necessary if your craft folder is below the webroot. However, it's good practice to have a robots.txt for each site, so I don't ...
user avatar
  • 3,400
4 votes

Best SEO plugin for Craft CMS - SEOmatic vs SEO plugin

I have used SEOmatic for years on Craft 2, but since it became a paid plugin on Craft 3 I trialled other SEO plugins. I realised the extra work needed to make other plugins have a result like ...
user avatar
  • 1,032
4 votes

How do I change the append title value from a template?

Looks like this was a setting in the Sprout SEO Plugin for Craft 2, as a quick Google search for 'craft appendTitleValue' will tell you. Apparently, it has been removed in the version of the plugin ...
user avatar
  • 6,340
3 votes

Change posts url without losing SEO positioning

Use a plugin like Retour to do a 301 redirect.
user avatar
3 votes

Can I add a custom canonical URL to a page if also using SEOmatic?

Robin's answer above is valid, but I have managed to create an override in my main _layout template like this: {% if entry.canonicalUrl|length > 0 %} {% set seomaticMeta = seomaticMeta | merge(...
user avatar
3 votes

Website not indexing

You need to tell Google that you have a new site or the best SEO in the world won't matter a jot; Google has no idea your site exists until you tell it. There are 4 essential steps to getting your ...
user avatar
3 votes

Approaching Google AMP

To revitalize this valuable post and expand a bit on what the accepted answer covers: I've done this using the same template (with conditionals). Since you're going to have to handle all of your ...
user avatar
3 votes

Approaching Google AMP

I wrote the SEOmatic plugin -- AMP is really just a name for some best practices for web development that speed things up on mobile. There isn't anything terribly special about it, I do most of what ...
user avatar
3 votes
Accepted

File robots.txt needed in Craft package?

I think it's there to protect those who can't have craft/ below web root. In your case it can't be found by search engines, so you can delete it.
user avatar
  • 35.8k
3 votes
Accepted

If URL Contains x Then Do Y in Twig / Craft Template?

If the string you're looking for is part of the URI segment, then something like: {% if (craft.request.getSegment(3) == 'mySpecialKey') %} <meta name="robots" content="noindex, follow"> {% ...
user avatar
  • 66.4k
3 votes

Best SEO plugin for Craft CMS - SEOmatic vs SEO plugin

Bias warning: I am the author of SEOmatic for Craft CMS 3, so I'm obviously not impartial here. However, what I'd suggest you do is install the both, and try them out. You can do that pretty easily ...
user avatar
3 votes

URL Structure - advise and thoughts of best approach?

I’d go for /hot-tubs/used etc This way you can also have /accessories/pipes etc
user avatar
  • 1,032
3 votes

URL Structure - advise and thoughts of best approach?

The general rule of thumb is to start with the most general thing, and end in the most specific thing. The nice part of this is that it makes sense to humans, too. I'd go with /hot-tubs/new/name-of-...
user avatar
2 votes
Accepted

url with .html extension

Okay. I found the solution If anyone runs into the same issue. This must be a server problem which I can't solve so there is a htaccess solution to remove the .html extension: RewriteEngine On ...
user avatar
  • 3,664
2 votes

Advanced routing descriptive URLs to certain pages/posts

So from an SEO perspective, the first URL is actually better, in that it provides even more context for the search engines to digest, index, and understand. It's also bad from an SEO perspective to ...
user avatar
2 votes

SEO Title Tags Not Showing

It would be helpful if you post your code instead of a link, as the metadata available on the linked page may change. A few considerations: Make sure your page is outputting metadata for each of the ...
user avatar
  • 13.2k
2 votes

SEOmatic not merging fields from a related entry

Make sure you're not doing this inside of a {% block %} or you will run into Twig Processing Order / Scoping issues. There are some good examples of doing that here: Dynamic Twig SEO Meta
user avatar
2 votes

Why are my SEOmatic Entry Metas not overriding Sitewide SEO?

If you added the SEO Meta FieldType to existing entries, you'll need to re-save each section in order for it to start pulling content for you. I'm assuming that's what is going on here; see for more ...
user avatar
2 votes
Accepted

301 redirects not working

I wrote the Retour plugin; it will definitely work. However it only kicks in after 404 error is thrown by Craft. So if some route resolves to the URL in question, it won't kick in (because, by ...
user avatar
2 votes
Accepted

How Do I Add a rel="canonical" HTTP Header to Embedded PDF Files?

So the problem you're running into is all about context. Twig operates in the context of the http request for the parent page; so any headers you add via Twig will be added to the page http header, ...
user avatar
2 votes
Accepted

Nesting block tags doesnt work

Unfortunately it’s not possible for an included template to override the contents of a block in the parent template, or its layout. You’d need to just override the seo block from page.twig do ...
user avatar
2 votes
Accepted

SEOmatic Errors in Debug - Can they be fixed?

These errors will only appear with devMode on, and they are intended to help you diagnose potential problems with the meta tags and other information that you are rendering. These are all soft errors,...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible