Open klonos opened 3 years ago
Wouldn't that conflict with existing contrib modules?
Curious, are facebook and twitter search engines? If we're talking about SEO, then I would recommend only adding tags for search engines.
The vast majority of sites will want to be indexed for search, but not all websites are going care about their visibility on social media.
After thinking about it, it's not a bad idea to include basic tags for the social media sites... I do think the majority of social media tags should be left to contrib. Let core handle the most important ones though. Wondering if the title needs updated to include Social Media?
It also might not be a bad idea to create a new area in configuration specifically for these types of tags and let contrib either extend that area or alter it. I think it would be nice to have core handle the initial bits and give contrib a designated place to add to it. (In other words, outside of the currently proposed area)
Wouldn't that conflict with existing contrib modules?
It might. That's why we discussed to implement this in a way that would easily allow contrib to either override or completely remove any core-added meta tags.
These are the SEO-related modules I'm aware of, along with their current usage counts:
Perhaps that list and data will help us decide re possible impact on existing sites. The way I am reading that data is:
It seems that if we coordinated any core changes with the maintainers of the most popular of these, we'd minimize risk of any possible breakage. Perhaps the battle plan would be to:
My point is that if we implemented default meta tags, we'd provide an effortless benefit to all Backdrop sites OOTB, without site builders/owners having to lift a finger ...unless they wanna tweak further, in which case they should install and configure one of the contrib modules. But I do understand that we shouldn't break existing sites π
It seems that if we coordinated any core changes with the maintainers of the most popular of these, we'd minimize risk of any possible breakage.
I'm afraid that could never cover custom implementations. I'm a bit scared of doing such a potentially breaking change, and I don't fully understand the need for it. Things are in contrib already.
Honestly, for me this currently looks like a 2.x issue, but I might be wrong.
@indigoxela what if the solution we come up with is done in way that doesn't break contrib and doesn't break custom code? Wouldn't the improved OOTB SEO benefit the 70% of Backdrop sites? (which is 10% short of being the 80%, which we prioritize)
What we can do is to work towards making sure that core is adding tags only if contrib/custom solutions have not provided any already. Alternatively, make sure that there is proper "weight", so that contrib/custom implementations come after the core ones (so that they can override it).
A quick research shows that adding meta tags is done via backdrop_add_html_head()
, so if contrib/custom implementations stick to that, they should be able to override what core adds. I would like us to explore that option before we dismiss any solution, in fear that it might break existing sites.
update: https://www.zyxware.com/articles/4817/drupal-how-to-add-meta-tags-programmatically-to-custom-pages-in-drupal suggests that hook_html_head_alter()
can be used to override meta tags:
https://docs.backdropcms.org/api/backdrop/1/search/hook_html_head_alter
Alter XHTML HEAD tags before they are rendered by
backdrop_get_html_head()
.
Curious, are facebook and twitter search engines? If we're talking about SEO, then I would recommend only adding tags for search engines.
No, they aren't search engines @philsward. That's why I mentioned that:
a) Facebook respect/support og:*
tags, which are an open standard that is used by search engines.
b) twitter uses custom twitter:*
tags, which is why I said that we should consider adding them.
In fact, I am not proposing that we add all of the tags I list in the issue summary. Every section is a result of my research of what seems to be supported, and what at the same time already matches what we output. For example:
name="description"
and property="og:description"
config_get('system.core', 'site_name')
matches property="og:site_name"
property="article:author"
...not all websites are going care about their visibility on social media.
Agreed π ...AFAIK, the social media tags are not being used to produce something that social media crawls actively. The are being used when for example someone posts a link of a site in one of those social media platforms. For example, this is what was produced when I posted a link to a site with such tags in our company's Slack channel:
Notice how the link to the AltaGrade site produced an automatic "preview" with a beautiful custom summary in Slack (the way that the site owner specifically configured it for that page - not just the random x first characters of the page content). Also notice that the link to backdropcms.org produced absolutely nothing! That's what we are trying to improve here, OOTB.
...I think it would be nice to have core handle the initial bits and give contrib a designated place to add to it. (In other words, outside of the currently proposed area)
Yup, that's the idea: core provides an automated, "lightweight" set of defaults, which make sense and work for 80% of the cases. At the same time, nothing is hardcoded, so that contrib/custom solutions can build on top of that.
Honestly, for me this currently looks like a 2.x issue, but I might be wrong.
@indigoxela here's another thought: how about some sort of setting (either visible/configurable via the admin UI, or "hidden" as a settings.php option) which makes sure that all these new SEO options are not enabled for existing sites (no update hook to add it), whereas it is on by default for new sites?
@klonos Besides the fact that I still don't get the "why"... :wink:
Some of the tags you propose need values set, that can't exist "automagically", like the image field for "og:image" and the image attributes. Some need clear decisions, where to use them (e.g. not everything is supposed to be an "article with an author". This requires at least some base knowledge, what these meta tags are supposed to do.
That's why I'm totally fine with the fact that most of these special meta tags are a job for contrib. In fact, different existing modules provide different complexity, which is another advantage of contrib (lightweight tool or complex beast - depending on demands).
Regarding convenience for the site builder or admin when everything (or at least a lot) is in core: Is it really that exhausting to click around a little bit to install a contrib module via the installer? :confused: My personal experience with those additional meta tags is: the module is installed very quickly - the cumbersome part is to set them up.
But maybe the SEO experts in our community (I'm none) want to share their thoughts here, too.
I can see where custom content types become a bit hairy with defaults, but the fact of the matter is that Backdrop does nothing outside of the bare minimum for SEO and social media.
I like the idea of core handling the foundation of SEO tags by creating a common and familiar place to configure it with a few basic defaults, then let contrib extend it.
I think the biggest reason 70% of sites don't use the contrib is because they aren't aware of them, or the site owners don't know they need them, or in my case I completely space on adding them. Then there's the issue of 4 different modules that claim to do the same thing, just a little different so it becomes overwhelming to decide which one is actually the best and going to do what is needed, and also going to do what is advertised.
I think for content types, views, terms and layouts, just having a place where tags can be configured (minimum of title and description) would be great. Leave them blank with no default but at least they have the ability to allow seo tags. Let a contrib like metatag insert the token. This would also allow custom entity pages to tie into the core seo api by default so contribs don't have to manually add it to the list later.
If core has an API for SEO that allows contrib to tie into it, then make it a sub-module of core that can be disabled to reduce clutter and overhead for say an internal or locally hosted site.
So, I'll agree that a good idea is to have core handle the foundation, and I also think it's a good idea to not enforce too many arbitrary defaults.
Some of the contrib will require major rewrites to tie into the api, but that's the cost of making things better at the core level. It's always been frustrating to remember to add xmlsitemap and metatag to every site after everything else that needs to be done to a site to get it going. If I were to see a blank title and description meta when adding content to a page, it's a reminder to go add the token metatag to help automate it. If it isn't there, I'll completely forget to add it.
I think I would start by incorporating something like the metatag module as the foundation and stripping out some of its complexities, leaving those complexities inside metatag as contrib.
So, in case of positive decision. We need new core module that should:
I forgot something?
Some of the contrib will require major rewrites to tie into the api, but that's the cost of making things better at the core level.
I think, this needs some feedback by the module maintainers (one already did) - at least the ones we know - as Backdrop "values the needs of the contrib developer over the needs of the core developer". Keep in mind, we can't get feedback regarding custom code (in custom modules or themes) out there.
Migrations from D7 also have to be considered.
If the proposed solution requires a fundamental API change, we have to be very careful, and potentially have to postpone the change until 2.x.
@indigoxela - I don't know if this helps with the "why" question, but this was discussed during one session at Backdrop LIVE. The discussion was about all the things that almost every site needs, but are not currently included in Backdrop core. We discussed things like metatags and site maps. The consensus was that many site owners are not aware of the need for these things and may never implement them despite the fact that virtually every site probably should have them.
We then talked about ways that Backdrop Core might help these site owners. I think that there was some consensus that (in that specific discussion) that if Backdrop Core should not try to take on too much of this work, but if there is some basic meta tag information that could could reliably provided, then maybe that should be provided by core and we should leave the advanced/custom stuff to contrib.
I support the goal of making life easier for this type of user, but I'm not sure what is practical and/or if there are other good reasons to NOT do this.
@findlabnet forgot layouts.
Single path layouts will need this as well.
@klonos Besides the fact that I still don't get the "why"... π
@indigoxela the why is clearly stated here: https://backdropcms.org/philosophy
- Simplicity: Write code for the majority.
- Focus: Include features for the majority.
I believe that I clearly demonstrated that it seems that 70% of the Backdrop sites out there do not do anything about SEO, which hurts site owners (and they might not even know about it). This also hurts Backdrop as a product, as having some "automagic" SEO out of the box would increase its marketing value.
Is it really that exhausting to click around a little bit to install a contrib module via the installer? π
No, that part is not exhausting at all.
...the module is installed very quickly - the cumbersome part is to set them up.
Exactly! We are making knowledge assumptions here. People managing/building/owning these sites need to:
That is a lot of work as you can see. And sure, they can hire people to do it for them, but that then goes against the "affordably" in "build highly customized websites affordably".
That's why I'm totally fine with the fact that most of these special meta tags are a job for contrib.
Fully agree with that π ...I am NOT proposing to merge the Metatag contrib module functionality into Backdrop core; I am NOT proposing that we add ALL of the meta tags I have researched and added in the issue summary - just the ones that make sense, and are minimal, non-breaking change.
...the fact of the matter is that Backdrop does nothing outside of the bare minimum for SEO and social media. ...core handling the foundation of SEO tags by creating a common and familiar place to configure it with a few basic defaults, then let contrib extend it.
...if there is some basic meta tag information that could could reliably provided, then maybe that should be provided by core and we should leave the advanced/custom stuff to contrib.
Yup. That ^^ π
If core has an API for SEO that allows contrib to tie into it...
SEO is basically adding meta tags to certain items in the <head>
of each page. And Backdrop already has the necessary functions to allow for that. I'm pretty sure that all the SEO contrib modules use these functions.
Keep in mind, we can't get feedback regarding custom code (in custom modules or themes) out there.
I'm not sure that people would custom-code SEO when there are modules like Metatag, but I really doubt it. I'll admit that we don't have the metrics to back this up, but we don't have any metrics to claim the opposite either. I'd be willing to have whatever core solution comes out of this have a flip on/off switch (whether that's a separate module, or a global "Enable basic SEO" setting).
One thing I'd want to know is that if people custom-code SEO, then how would they do it? Would it be by creating entirely new templates? in other words, would they bake SEO into their custom themes? Having some knowledge around that would help us avoid breaking things for them.
Migrations from D7 also have to be considered.
Can you please elaborate on that @indigoxela? I agree that this is an important point π
I believe that I clearly demonstrated that it seems that 70% of the Backdrop sites out there do not do anything about SEO, which hurts site owners (and they might not even know about it).
My shop runs dozens of Backdrop sites as containers/CMS front-ends for CiviCRM; we consciously don't want to do anything about SEO for those sites. Just dropping that perspective in here!
...we consciously don't want to do anything about SEO
Wondering why that @jackaponte. I thought that SEO was a good thing in general. Does it have hidden drawbacks?
edit: I just saw your reply in Zulip @jackaponte
As I posted on the Github issue, my shop has a number of certainly not illegal nor testing Backdrop sites that serve primarily as containers for CiviCRM, with no public content at all. We have no interest in SEO! (For those particular sites.)
Fair enough, but that doesn't mean that any baked-in SEO provided by core would hurt those sites. Right? ...or am I missing something?
I think @jackaponte is pointing out additional bloat their environment sites don't need.
I like the overall idea, but I would push for it to be a sub-module of core that can be disabled for this very reason. If a local site or internal site doesn't need it, shut it off.
Otherwise out of the box, I agree that @klonos assumption that SEO is wanted, is a proper assessment. I've wished for years that Drupal would have done a better job on this front. It's like they made it great for SEO back in 2005 and then never gave it another thought.
Current OOTB header for a vanilla Backdrop site, when visiting the home page:
Proposing to add the following basic meta tags:
Home page
Allow these to be configured from the site information page in
/admin/config/system/site-information
(same as site name, slogan, and favicon).Note: see https://developers.facebook.com/docs/sharing/best-practices
Personal note: long sentence w/o any punctuation triggers my OCDs π ...you'd expect that Facebook would know better π€·
Social-media-specific meta tags
OpenGraph (
og:*
) seems to be supported by Facebook, twitter has specific tags:Additional meta tags to consider for Post nodes
Additional meta tags to consider if the node is part of a Book
(if the book module is enabled)
Generic meta tags to consider for any node type:
Meta tags to consider for user profile pages:
Views-generated pages
Perhaps consider extending views to allow a visitor-facing description (besides the admin description), then use that as
<meta name="description" property="og:description" content="...">
if the page being rendered is a view.Page title
Note that we are currently rendering this:
If we want to support or optimize for OpenGraph and schema.org, the we should be doing this instead:
The above combines w3c (
name="description"
), schema.org (property="schema:description"
), and OpenGraph (property="og:description"
).