Is there a way to globally change default domain?

Hi, I’ve just gone live with my first treepl site.
Is there a way to globally (for the site) tick the ‘Show this page for search engines’?
There must be, otherwise it could take days to simply perform this for some sites.

It’s not practical to do this for- for every page:
go into page (wait),
then go to the seo tab (wait),
scroll to ‘Show this page for search engines’
click and save (wait)
go back (wait)
go into next page (wait) etc…

Its ok, I found it :slight_smile:

How about for SEO rel="canonical
its using the *treepl.co domain on every page.
can this be globally changed, or is it a case of going into every page to change it?

I can seen in ‘Domains’ there is a green light next to *.treepl.co, but i can figure out how to change it so our new live domain has the green light for default?
Is this something i need to get the treepl team to do?

Hi @Reagan_Vautier. The green dot for the default domain is just a bug/limitation at the moment.
Your activated domain should be the default throughout the site now.

I can’t replicate the canonical issue you described. How is the canonical tag coded in your template?
What value/link are you adding in the canonical field for the page?

I found the same issue when going live with my first site. I entered the canonical with the domain I would be using for the site. At some point before, during, or after it went live I noticed that the canonical site was trialsite.co. This was flagged in Google Search Console.
Now I use liquid to fill it in. You can use {{request.request_url.origin}}/page or to make it even easier I created a site information tag called canurl so all I have to do is put in {{canurl}}/page in the canonical field and I am good to go. Once I go live with a site I don’t have to worry about it.

1 Like

Hi Adam,

My original screengrab shows treepl still has the default domain is set the the *.treepl.co domain as shown by the green light. This has not changed to my activated domain.

I have no code in the template for inserting the canonical.
The system is rendering this into the page from the content in the
Content > Pages > Page > SEO Tab > ‘Canonical Link’ Field.

The content of this field must have automatically generated and populated at some stage

It seems to have the means to perform this auto generation as the (chain link icon) selector on the right of the field allows the domain component of the URL to be selected independently to the page url component to construct a full absolute URL.

My guess is that this canonical domain selector defaults to the default domain set in the Settings > Domains > ‘Site Domains’ tab and as mine has not changed to my activated domain, my canonicals are still set to the wrong domain.

I can manually change this in every instance of a Page and Page Folder, but this will burn a lot of time.n I need it globally changed.

Rhatch offers a solution as long as this is done prior to going live, however I have already gone live.

@Reagan_Vautier you could bulk change the canonical value via a page export/import.
I’d do to test with just importing one page just to ensure everything works ok.

I’ve manually changed them all.

My method of choice for doing the canonical link is to put this in the head of every page:

<link rel="canonical" href="https://{{siteinformation.dev.canonical}}{{this['Url']}}">

{{siteinformation.dev.canonical}} is referring to a parameter in site information for setting the domain I want to use for canonical.
But that seems to be so obvious and simple that I ask myself: Is there something I’m missing here, @Adam.Wilson?

3 Likes

Yeah, I think that’s a good approach @TimL.
We also now have this component: {% component type: "domain_settings" %}
Docs: https://docs.treepl.co/documentation_group/component-types/domain_settings

Which will output the current domain and its related settings so it may be of use here. Although it outputs the current domain being used, so if you have a multi-domain site it might not be the right approach for setting the canonical (or maybe it is?). But for most sites it should suffice.

I’d like to see this component, or one like it, able to output the default domain set for the site and just one central place for assigning the default/primary domain. At the moment it seems we have to set this in a few different places.

2 Likes

I forget, does liquid work in the SEO fields? Could we use https://{{siteinformation.dev.canonical}}{{this['Url']}} in the canonical field on the SEO tab? If so, that would be a nice default.

@Alex_B_Centrifuge yes Liquid is supported in the canonical field.
But we can’t yet set default values :frowning: (unless you were always to create a new page form duplicating a predefined ‘master’ page).

@Adam.Wilson Yeah, I guess the missing piece would be having the default domain available via the domain_settings component and then making the default canonical link on the SEO tab (i.e. the default when any page is created) be something along the lines of
{{domainCollection.DefaultDomain}}{{this[‘Url’]}} or something along those lines.
That way the canonical would always be populated with something sensible, but customization.

Definately having the actual default/primary domain available would be great, ie {{domainCollection.DefaultDomain}}
But I think managing what the default canonical is should be done in the page template where we have more control, ie:

{% if this.CanonicalLink != null %}
{{domainCollection.DefaultDomain}}{{this[‘Url’]}}
{% endif %}

…or any other implementation you might need.

On this topic, is it actually necessary to set a canonical link if your pages don’t have other URLs the content can be accessed with? (which would be the case for most sites)

I’d be happy to be proven wrong here (because it would save me some work), but because all pages are accessible via /page /page.htm and /page.html , if you want to specify one name and not be interpreted as having duplicated content then canonical is a requirement for SEO reasons.

SEMRush is giving me a duplicate content error as you stated above. But I am not sure how to go about fixing it. Do i just put the full url that I want onto the canonical link field? And I think the duplicate content warning I am getting is because pages end in with a “/” and then another page without the “/” at the end of the file name —though not sure…

I’m definitely not an expert on this. There are lots of people that understand SEO better on these forums. But yes, that is my understanding of the purpose of a canonical link. Specifying one URL for your content avoids you getting penalized for duplicate content.

1 Like

Ah, I didn’t consider page extensions or a trailing forward slash would be considered as seperate pages :frowning:
Good point.