Hello, I have a question that I think is simple. By enabling the visual editor one can write content in the custom post type (which would not be visible in the front-end) but this content is easily recognizable by other plugins
What I would like to achieve is for each custom post type to have as content something like [types field='custom-description' output='raw'][/types]. This way my SEO plugin can collect the first 160 characters as an SEO description
In my particular case, if I put "custom-description" in description I may have descriptions that are too long, that's why I would like to insert it as content for all custom post types
It's possible? Basically I am referring to the description that SEO plugins usually detect and generate automatically (I am working with Rank Math)
The question may seem simple, but I'm not quite sure what you mean 🙂
"enabling the visual editor one can write content in the custom post type (which would not be visible in the front-end)"
Let's just be clear about what we mean by content when editing posts.
A post has a title, and it has post content (with the classic editor that is a tinyMCE editor with Visual and Text tabs; with the block editor its where you add blocks, with page builders its where you insert page-builder modules).
When you display such a post on the front end, your theme will almost certainly output the post title, and the post content.
The post may also have custom fields (post meta), which typically are not output by your theme unless you modify the theme to include custom templates, or if you use a visual template editor like Toolset where you might output values of the custom fields.
Now, you talk about default content for a custom post type.
You mean all post types should start with the same content, which can be overwritten? And you are referring to post content, or to custom fields?
You mention a custom-description custom field, but a custom field only applies to a single post, not to all posts of a post type.
I'm sorry, I'm not understanding very well what you are asking, if you could please elaborate.
I've done more experiments and what I had in mind doesn't work
But I explain it with this image, I simply wanted to place content as a "common post" to a custom post type. Unfortunately Toolset shortcodes don't work, my SEO plugin could only detect the "Plain text" in the example
Before closing the ticket I would just like to know if more people have faced this problem. Simply put, I would just like to know if I can do something so that the SEO plugin recognizes the content of the custom post type (in my case so that it generates an excerpt automatically) or if there is a simple way to insert a custom field as " normal post" (in my case, so that it is treated as the "plain text" of the example)
I know it's a very unconventional approach (obviously I work with the Toolset content template myself). But it may be interesting to select some custom fields to be inserted as a normal post to optimize integration with third-party plugins such as WordPress itself
As you are using RankMath and we do not have any integration with that plugin.
In addition to that RankMath uses very specific Javascript to integrate custom fields. Better you may contact RankMath plugin support and check with them if they have any ideas to have better solution compare to what you have currently.
Okay, maybe in the future you could consider a way to insert content as a "normal post" in wordpress, it would be an interesting way to optimize with third party plugins and with wordpress itself