We changed our privacy policy. Read more.

Hot answers tagged

33

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 these three fields in a Global group called "globalSeo". In your layout template "layouts/_layout.html" {% set seoTitle = globalSeo.seoTitle %} {% set ...


16

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 and Sprout SEO plugin are both available and $99. If you'd rather not use a plugin, then you're on your own to create and implement whatever fields you think ...


15

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 subset of HTML. When compared to something like WordPress, Craft is going to give you all the tools necessary to spit out an AMP page just by virtue of it doesn'...


14

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 not free).


8

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 and then user your browser tools to check different devices Is it possible to publish only a subset of my website? Yes, each entry can be turned on or off ...


5

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 of where your old website stands. This can be a combination of using tools like Google Analytics, Screaming Frog, moz.com, raventools.com, or one of many other ...


5

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 %} {% set seoTitle = config.seoTitle %} <-- fallback if nothing is defined {% endif %} <title>{{ siteName }} - {{ seoTitle }}</title> _entry.twig ...


4

Default limit is 100, try adding .limit(null) to the query


4

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 recommend deleting it altogether. You can change the directives to fit whatever robots criteria you need for your site. (For example, if you launch a beta site, you'd ...


4

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 SEOmatic's wasn't worth the time over the extra cost to install SEOmatic and be on my way. I'd recommend SEOmatic, but if you have the time to make a free SEO plugin ...


3

Use a plugin like Retour to do a 301 redirect.


3

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({'canonicalUrl': entry.canonicalUrl}) %} {% endif %} {% hook 'seomaticRender' %}


3

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 site indexed: Add your URL – Submit your website for inclusion in Google's index. App crawling – Get your app indexed by Google. Search Console – Submit a ...


3

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 they list in their spec for websites already. The "meta tags" that they want you to add are just some JSON-LD, which you can easily add on your own, or via ...


3

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.


3

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"> {% endif %} (Adjusting the 3 for whichever part of the segment it's actually in. Or if it's part of the querystring, then use craft.request.getParam('...


3

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 with the Craft Plugin Store. I think you will find that SEOmatic has many features that aren't available elsewhere, but depending on your needs, that may not ...


3

I’d go for /hot-tubs/used etc This way you can also have /accessories/pipes etc


3

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-hot-sub for that reason... in addition to reading well (just from the URL, you know what it is), you'll have more flexibility in the future. Try to have your ...


2

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 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)\.html$ /$1 [L,R=301]


2

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 have two pages that have the same content. As long as you include a canonical URL it won't really hurt you, but the only real benefit I see from using your ...


2

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 routes manually anyways, I've set up a controller (in a plugin) to give me a little more control over what data these pages get. By wrapping the renderTemplate ...


2

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 services you mention. It looks like you are outputting some basic and Open Graph metadata, but you don't appear to have any Twitter Card metadata. I've added a ...


2

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


2

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 details: https://github.com/nystudio107/seomatic/wiki/05.-SEO-Entry-Meta


2

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 definition, it is then not a 404)


2

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, which is not what you want. This could be done server-side, as the article you reference mentions. But it becomes a bit more involved when we're dealing with ...


2

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 whatever you need to do from there instead. {% extends 'layout.twig' %} {% block main %} some content.. {% include 'pagination.twig' %} {% endblock %} {% block ...


2

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, though. You can safely ignore them if they are a result of you not filling in things that you don't intend to fill in. You can read more about it here: ...


2

So this isn't a simple answer, because we don't know how the SEO has been implemented on your particular site. It could have been done manually, or they could have used my SEOmatic plugin or it could have been another plugin. You also don't mention what version of Craft CMS you're using. In any event, what that SEO tool is telling you is that the <meta ...


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