Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

SEO Plugin

default discord avatar
arinji.2 years ago
17
https://payloadcms.com/docs/plugins/seo#examples

How do i disable the preview?



Also why is this 2/3





Bump

  • discord user avatar
    seanzubrickas
    2 years ago

    Hey

    @890486507872342027

    I'll try to get someone's eyes on this today. Not sure off the bat why the valditation wouldn't be passing if you've filled out all three fields.

  • default discord avatar
    arinji.2 years ago

    thanks, btw any idea about removing the preview thing?

  • discord user avatar
    seanzubrickas
    2 years ago

    I'm not sure if there is a programatic way to turn that on/off, could always hide it with CSS if you don't want to see it.



    Hey

    @890486507872342027

    - I am not seeing a meta image in your screenshot, have you made any changes to your code to hide or try to disable that?



    and what version of plugin-seo are you using?

  • default discord avatar
    arinji.2 years ago

    Yea I didn't put the media collection option



    Lemme show code one sec

  • discord user avatar
    seanzubrickas
    2 years ago

    That is the problem - it's looking for that, so it will never pass that way

  • default discord avatar
    arinji.2 years ago

    But isn't it optional?



      plugins: [
        addAuthorFields({
          excludedCollections: ["users"],
        }),
        seoPlugin({
          collections: ["article"],
        }),
      ],
  • discord user avatar
    seanzubrickas
    2 years ago

    How are you hiding the meta image field atm?



    with CSS?



    however you are hiding it, the reason the checks are not passing is that there is still js logic that is looking for that field, so this sounds like a feature request, a good one at that.

  • default discord avatar
    arinji.2 years ago

    not hidding it at all lol



    this is all i do with the seo plugin



    import { lexicalHTML } from "@payloadcms/richtext-lexical";
    import { AfterReadHook } from "payload/dist/globals/config/types";
    import { CollectionConfig } from "payload/types";
    
    export const Articles: CollectionConfig = {
      slug: "article",
      access: {
        read: ({ req }) => req.user && req.user.role,
        create: ({ req }) =>
          req.user && ["admin", "editor"].includes(req.user.role),
    
        update: ({ req }) =>
          req.user && ["admin", "editor"].includes(req.user.role),
        delete: ({ req }) =>
          req.user && ["admin", "editor"].includes(req.user.role),
      },
    
      admin: {
        useAsTitle: "title",
      },
    
      fields: [
        {
          name: "title",
          type: "text",
          required: true,
          admin: {
            placeholder: "Title of the article",
          },
        },
    
        {
          name: "link",
          type: "text",
          required: true,
          admin: {
            placeholder: "Link to the article",
          },
        },
        {
          name: "Category",
          type: "relationship",
          relationTo: "category",
    
          required: true,
        },
        {
          name: "SubCategory",
          type: "relationship",
          relationTo: "sub-category",
        },
    
        {
          name: "ShortTitle",
          type: "text",
          admin: {
            placeholder:
              "Short Title of the article, required if title is > 3 words (Optional)",
          },
        },
    
        {
          name: "content",
          type: "richText",
          
    
        {
          name: "author",
          type: "relationship",
          relationTo: "users",
          defaultValue: ({ user }) => `${user.id}`,
          required: true,
        },
      ],
    };

    This is my articles collection

  • discord user avatar
    seanzubrickas
    2 years ago

    what version of plugin-seo are you using in your project?



    by default, you should have a field that looks like this for meta image



    but to your statement above about media collection - you would need that in order for this field to work



    it is stopping you from saving the page? if not, and you are planning to render a static OG image for this page, or all pages, since this is not an optional field atm you'd just ignore the warnings

  • default discord avatar
    arinji.2 years ago
    @364562745447940099

    apologies, i forgot to reply


    Version is 2.2.1


    Yes i have an OG image for my metadata i generate on the frontend so i dont need the media collection

  • discord user avatar
    seanzubrickas
    2 years ago

    no worries



    this sounds like a scenario we just haven't accounted for, specifically, wanting SEO plugin, but not the meta image, and also not having a media collection. We could adjust the checks in the logic, and if you want to open up a PR I can make sure we assign some priority to it for the future.

  • default discord avatar
    arinji.2 years ago

    sure, one moment



    wait an issue or a pr?

  • discord user avatar
    seanzubrickas
    2 years ago

    well, I would open it up as a discussion actually, that way when Jake is freed up (the artist behind the SEO plugin) we can talk about the best path forward



    my mistake

  • default discord avatar
    arinji.2 years ago

    sure



    https://github.com/payloadcms/payload/discussions/5100

    there you go



    you can mark this solved

  • discord user avatar
    seanzubrickas
    2 years ago

    Thanks for talking through this! This is a good feature request, appreiciate it.

  • default discord avatar
    arinji.2 years ago

    No worries :D



    @364562745447940099

    the discussion seems to be pretty inactive.. is this because of payload 3.0 beta?

  • discord user avatar
    seanzubrickas
    2 years ago

    Hello! Yes and no. Opening the discussion is a first step to getting something like this on our radar. We evaluate feature requests fairly often and assign them a roadmap priority or just simply assign them to an engineer. We haven't done that yet for this month as we're working towards the 3.0 beta, but we do address every single one.

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.