1. What this module does

Category pages rank on their text, but a long description above the products pushes the products down. The module adds an SEO text to the edit form of every category, in every language: an optional heading and rich text from the editor. The shop prints it under the product list, in full or as a preview with a Read more button. The whole text stays in the page, so search engines read all of it.

On the configuration page you can also write one common text that is added before or after the text of every category, with variables such as {category} and {shop}.

Works with PrestaShop 1.7.8, 8.x and 9.x (PHP 7.2.5 or newer), with the Classic and Hummingbird themes and with multistore.

2. Installation

  1. Download the module from My account → Order history at addonspresta.com.
  2. In your Back Office, open Modules → Module Manager and click Upload a module.
  3. Drop the ap_categoryseotext_v1.0.0.zip file and wait for the confirmation.
  4. Click Configure on the module card.

If you have shell access, you can also unpack the zip into modules/ and run php bin/console prestashop:module install ap_categoryseotext from the shop folder.

Nothing changes in the storefront until you write a text: a fresh installation has no category texts and an empty common text.

3. How it works

The module adds three fields at the end of the category form in Catalog → Categories (when you edit or add a category, and in the form of the root category). What you write there is shown on the category page under the product list, in the place where the theme prints the displayFooterCategory hook. Classic and Hummingbird print it right under the products.

  • The whole text is in the page. In preview mode the text is cut to a set height with a soft fade at the bottom, and a Read more button shows the rest. Search engines read the full text either way. Without JavaScript the visitor sees the full text.
  • First page of the list only. By default the text shows only on the first page of the list and disappears on page 2 and further and when the visitor uses filters, so the same text does not appear on many addresses.
  • The heading is an H2. It is printed above the text only when the block has text to show.
  • Common text. The common text of the configuration page joins the text of each category, before or after it. Its variables are replaced with the name of the category, of its parent category, of the shop and with the number of products. Variables work only in the common text: in the text of a category they stay as written.
  • "Additional description" of PrestaShop 8 and 9. PrestaShop 8 and 9 have their own Additional description field in the category form, always shown in full. The module's SEO text is a separate field and does not read or change it. When both are filled, the shop shows both: first the Additional description, then the SEO text. If you already use the Additional description for this purpose, move its text into the SEO text field and empty the Additional description, or keep both. PrestaShop 1.7.8 has no such field.
  • HTML like in a category description. Both editors accept what a PrestaShop category description accepts. Scripts, event attributes (onclick, onerror…), javascript: links, forms and embedded objects are refused, and so is an <iframe> unless Shop Parameters → General → Allow iframes on HTML fields is on. The module also refuses a tag left open (for example <strong without its >), because its texts are joined with other HTML on the page. When Use HTMLPurifier Library is on in the same place, the HTML is cleaned by it on save, as PrestaShop does for a category description.
  • Styles of your theme. The module adds no colours or fonts: the heading, the text and the button look like the rest of your theme.

The texts are stored in two tables of the module, per category, shop and language. The module does not change the description of your categories or any other PrestaShop table, does not set cookies and does not connect to addonspresta.com or any other server.

4. Features and settings

Open Modules → Module Manager → Category SEO Text → Configure. The Help box at the top links this manual, the module page at addonspresta.com and our support address, and shows the installed version. Below it, the Settings panel holds the options for all categories; click Save at the bottom of the panel. The text of each category is written in the category form, described at the end of this section.

Display

How the SEO text of a category is shown when the category does not choose it itself (its own SEO text display field is on Module setting):

  • Preview with a Read more button (default) — a long text is cut to the preview height; the button shows the rest and then changes to Show less.
  • Full text — the whole text is always visible.

Preview height

The height of the visible part of the text in preview mode, from 40 to 2000 px, 150 px by default. A text that is at most 40 px taller than this height is shown in full, without the button: hiding two lines behind a button helps no one.

Only on the first page of the list

On by default. The text shows only on the first page of the product list without filters: it is not printed on page 2 and further, nor when the visitor uses filters (for example with the Faceted search module). This keeps the same text from repeating on many addresses, as PrestaShop 8 and 9 do with the Additional description of a category.

When the list changes without reloading the page (pagination and filters in Classic and Hummingbird), the text disappears as soon as the visitor leaves the first page and comes back when they return to it. A page opened directly at a further page or with filters (for example from a link to ?page=2) has no text in it, so the text does not appear there even when the visitor then goes back to the first page in the list; it is there again when the first page is opened anew.

Switched off, the text shows on every page of the list.

Show under the product list

On by default: the text is printed under the product list, in the displayFooterCategory hook of the theme.

The module also has its own hook, displayApCategoryseotextBlock, for a theme that wants the text in another place of the category page, for example above the products. Your developer puts this line into the theme's category template:

{hook h='displayApCategoryseotextBlock'}

The own hook always prints the text, whatever this switch says. When your theme uses it, switch this option off, otherwise the text is printed twice.

Common text

A text added to the SEO text of every category, written separately in each language with the editor. It can have up to 65 000 characters per language and follows the same HTML rule as a category text. The variables listed under the field are replaced on the category page:

  • {category} — the name of the category;
  • {parent_category} — the name of its parent category, empty for a category directly under the home category;
  • {shop} — the name of the shop;
  • {products_count} — the number of products in the list of the category.

The values are inserted as plain text, only in the text itself: a variable written inside a link address or another attribute (for example <a href="{category}">) stays as it is. A token that is not one of these four variables, such as {price}, also stays as it is.

The common text has no fallback: a language in which it is empty shows no common text, even when another language has one.

Position of the common text

  • After the category text (default).
  • Before the category text.

Common text in categories without their own text

Off by default: the common text is shown only next to the text of a category, so categories you have not written a text for stay without one. Switched on, the common text alone is shown in every category without its own text, for example a short paragraph about delivery or about the shop in every category.

SEO text heading

In Catalog → Categories, click Edit next to a category (or add a new one); the module's three fields are at the end of the form; the heading and the text each have their own language selector.

The heading is optional plain text of up to 255 characters, shown as an H2 above the SEO text. HTML tags typed into it are removed. The heading is shown only together with a text: a heading without a text (and without a common text) shows nothing.

SEO text under the product list

The SEO text of the category, written with the editor in each language: paragraphs, subheadings, lists, links, images. It is checked when you save the category, like the category description; a text with code that is not allowed is refused with the message "The SEO text contains code that is not allowed (for example a script or an event attribute)." and the category is not saved until you remove it. A language left empty shows no text of its own in that language.

SEO text display

  • Module setting (default) — the Display option of the configuration page.
  • Full text — this category always shows the whole text.
  • Preview with a Read more button — this category always shows the preview.

5. Multistore

The options of the configuration page are saved for the shop or shop group selected in the Back Office header. Select All shops to give every shop the same options, or a single shop to give it its own; the common text can differ per shop too. In the All shops or group context only an employee who manages every shop of that context can save.

The texts of a category follow the shop context of the category form, as PrestaShop does with the category name and description: they are saved for every shop of the context selected in the header and the form shows the text of the current shop. To give a category a different text in each shop, select that shop in the header before you edit the category. Saving the category in the All shops context writes the same text into every shop.

A new shop created with the data of another shop copied gets the category texts of that shop. Deleting a category deletes its texts in all shops. One licence covers every shop of the installation.

6. Uninstall

Module Manager → Category SEO Text → Uninstall deletes the module's settings, the common text and the SEO texts of all categories, in every shop and language. They cannot be restored; if you may need them again, back up your database first. To keep the texts, use Disable instead: the texts disappear from the shop and come back when you enable the module again.

The category description and the Additional description of PrestaShop are not touched in either case.

7. FAQ and troubleshooting

The text does not appear on the category page. Check that the category has a text in the language you are looking at and in that shop, and that you are on the first page of the list without filters. Check that Show under the product list is on, or that your theme calls the displayApCategoryseotextBlock hook. Then clear the cache in Advanced Parameters → Performance and reload the page.

I changed a text, but the shop still shows the old one. The module has no cache of its own, so the change is visible at once. If your shop uses a full-page cache (Varnish, a server cache or a caching module), clear the cached category pages after editing a text, as after any change of a category.

My category also has an "Additional description". Which one is shown? Both. The module's SEO text is a separate field and shows under the Additional description of PrestaShop 8 and 9. To show only one text under the products, keep only one of the two fields filled.

The text is printed twice. Your theme calls the displayApCategoryseotextBlock hook and Show under the product list is on. Switch the option off.

The category is not saved and the SEO text field shows an error. The text contains code that a category description does not accept either: a script, an event attribute such as onclick, a javascript: link, a form, or an <iframe> while Allow iframes on HTML fields is off. A tag left open is refused too. Remove it, for example in the source code view of the editor, and save again. The common text of the configuration page is checked the same way.

The common text does not appear in a category. Check that the common text is filled in that language. In a category without its own text, the common text shows only when Common text in categories without their own text is on. In rare cases the category text and the common text joined together do not pass the HTML check; that category then shows only its own text. Check the HTML of both texts in the source code view of the editor.

{category} is printed as it is. Variables are replaced only in the common text, not in the text of a category, and only in the text itself, not in a link address or another attribute. Check also the spelling: the four variables are {category}, {parent_category}, {shop} and {products_count}.

The Read more button does not appear. The text is short enough: only a text more than 40 px taller than the Preview height gets the button. Check also the SEO text display of the category and the Display option.

Do search engines see the hidden part of the text? Yes. The preview only limits the visible height; the whole text is in the page code from the start.

The Read more button is in English in my shop in another language. The module comes in English, Polish, French, German, Spanish and Italian. For another language, open International → Translations → Installed modules translations, select the module and your language, and translate Read more and Show less.

8. Updates and support

Updates are free for life: download new versions from My account → Order history at addonspresta.com and upload them like a new module. Your settings and texts are kept.

Support is included for 12 months from your order: write to mail@addonspresta.com or use the contact form at addonspresta.com (Monday to Friday, 10:00–16:00; we usually answer within 2 business days). Please include your PrestaShop version, the module version, your theme and the steps that lead to the problem.

Back to User manuals

Loading...
Back to top