Skip to main content

collective.behavior.seo

This small behavior adds extra fields used for SEO optimisation. Inspired by collective.seo, but the data store now uses dexterity/behavior practice.

Features

Adds fields SEO Title, SEO Description, Metatag Robots and Structured Data on an extra tab SEO on contenttypes where the behavior is activated.

When the fields contain values, the <title> and <meta name='description'> in the <head> section will be replaced. Also a <meta name="robots"> tag will be added.

In a control panel you can give a list of valid combinations of robot tags: follow/nofollow, index/noindex.

A Viewlet for Structured Data called collective.behavior.seo.structured_data register in the HTML Header Area by the plone.app.layout.viewlets.interfaces.IHtmlHead Viewlet Manager

An Interface for Adapter Registration and Resolution ICollectiveSeoStructuredDataAdapter

Use Structured Data

read more: https://schema.org

Two Options to provide Structured Data in the Website.

You can use both options together, the result in the Viewlet will then be concatenated.

If the behavior is not enabled for a Contenttype, but an adapter is registered, then the viewlet will be rendered.

  1. use the field in the seo tab

  2. register an adapter

  <!-- Adapter for a Document - inject JSON LD-->
  <adapter
      factory="collective.behavior.seo.tests.CustomStructuredDataVariant1"
      for="plone.app.contenttypes.interfaces.IDocument
           collective.behavior.seo.interfaces.ICollectiveBehaviorSeoLayer"
      name="json-ld-variant1"
      />
@implementer(ICollectiveSeoStructuredDataAdapter)
class CustomStructuredDataVariant1:
    """Additional structured data adapter."""

    def __init__(self, context, request):
        self.context = context
        self.request = request

    def get_data(self):
        """ Return a list or dict with data """
        """ see https://schema.org for all possible schema data """
        return {
            "@context": "https://schema.org/",
            "@type": "Organization",
            "name": "Plone Team",
            "url": "https://plone.org",
        }

Translations

This product has been translated into:

  • Dutch
  • German

translate content, please run

uvx i18ndude rebuild-pot --pot ./src/collective/behavior/seo/locales/collective.behavior.seo.pot --create collective.behavior.seo ./src/collective/behavior/seo
uvx i18ndude sync --pot ./src/collective/behavior/seo/locales/collective.behavior.seo.pot ./src/collective/behavior/seo/locales/*/LC_MESSAGES/collective.behavior.seo.po

Installation

Install collective.behavior.seo by adding it to your buildout:

[buildout]
...
eggs =
    collective.behavior.seo

and then running bin/buildout.

Or install it with pip.

Activate the add'on in the Plone Contron Panel. Then go to Dexterity Types in the Plone Control Panel and activate this behavior on selected content types.

Contribute

License

The project is licensed under the GPLv2.

Contributors

This add'on is a combination of several SEO add'ons and improvements for Plone 5.1:

Changelog

3.1.0 (2026-10-09)

New features

  • add structured data field to behavior @1letter

Internal

  • generate po files with uvx, remove pkg_resources

    $ uvx i18ndude rebuild-pot --pot ./src/collective/behavior/seo/locales/collective.behavior.seo.pot --create collective.behavior.seo ./src/collective/behavior/seo
    $ uvx i18ndude sync --pot ./src/collective/behavior/seo/locales/collective.behavior.seo.pot ./src/collective/behavior/seo/locales/*/LC_MESSAGES/collective.behavior.seo.po
    

    @1letter

  • update config with plone.meta @1letter

Tests

  • add more tests, increase test coverage @1letter

3.0.0 (2026-03-10)

Breaking changes

  • Make package Plone 6.2 ready. Use native namespaces. Still works on Plone 6.0 and 6.1, but due to the native namespaces it could conflict with other collective packages. [1letter]

2.0.2 (unreleased)

  • Nothing changed yet.

2.0.1 (2024-01-25)

  • Update Translations for 'nl' and add translations for 'de' [1letter]

2.0.0 (2023-03-14)

  • Fix ValueError during editing when robot tags in control panel are not unique. Fixes issue 2 <https://github.com/collective/collective.behavior.seo/issues/2>_. [maurits]

  • Add Continuous Integration for supported Plone and Python combinations. Uses tox, gh-actions, and collective/tox-action <https://github.com/collective/tox-action>_. [maurits]

  • Drop support for Python 2. Plone 5.2 and 6.0 on Python 3 are supported. For older versions, use releases from the 1.x branch. [maurits]

1.0.2 (2023-03-14)

  • Removed English locale. I think there used to be a need for this long time ago, but not anymore, as far as I know. [maurits]

  • Changed <head> to 'head' in help text and translations. <head> gets swallowed: you got "the section of a page" and now "the 'head' section of a page". [maurits]

  • Fixed broken html in edit form on Plone 6 due to Dutch typo. We used <head and this made the Save/Cancel buttons show only on the SEO fieldset. And this fieldset showed an extra footer. [maurits]

1.0.1 (2020-09-09)

  • Make python3.8 compatible. [fredvd]

1.0.0 (2020-08-17)

  • Make python3 compatible. [erral]

  • Update uninstall profile. [fredvd]

1.0b1 (2018-10-30)

  • Add robots field, Add control panel form with configurable list of robot tag preset combinations for editors to pick from. [fredvd]

  • Don't generate robots vocabulary on every request. [fredvd, mauritsvanrees]

  • Fix implementer decorator on SEOFields behavior in python. The zcml registration was correct though. [fredvd]

  • Revert name changes. [jladage]

  • Improve description of robots field. [jladage]

  • Autopep8 and fix code-analysis feedback. [jladage]

1.0a1 (2018-10-12)

  • Override update method on TitleViewlet instead of page_title, otherwise Site title still gets appended to the overridden title. [fredvd]

  • Basic version, only for Title and Description [fredvd]

Metadata

Release files for collective.behavior.seo 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for collective.behavior.seo 3.1.0
File Size Uploaded
collective_behavior_seo-3.1.0.tar.gz 35.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for collective.behavior.seo 3.1.0
File Interpreter ABI Platform
collective_behavior_seo-3.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 82.3 kB

Release files / collective_behavior_seo-3.1.0.tar.gz

Download URL collective_behavior_seo-3.1.0.tar.gz
Size 35.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e2f8ca8788d661f1fca0bdc24cb0c5d81c459b7fae469b6dd4fc5575e874be82
BLAKE2b-256 checksum
How to use checksums
e886a826d4f967bf59fc258da592f57d257e9ecf992d8a9ade76c8df5f4f5c8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release files / collective_behavior_seo-3.1.0-py3-none-any.whl

Download URL collective_behavior_seo-3.1.0-py3-none-any.whl
Size 46.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
592e703d1ab63290ef390e36f97dbe3b728e61ffbe0842aee87ada11ea232157
BLAKE2b-256 checksum
How to use checksums
fd15fb71a45aa4ff4f294d97d8ca1e09f1fe183293a73263d8ad627770ca6e1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release history Release notifications | RSS feed

3.1.1

2 release files

This release

3.1.0 This release

2 release files

3.0.0

2 release files

2.0.1

2 release files

2.0.0

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page