• Resolved taylorthain

    (@taylorthain)


    I’ve been using PODs to create custom post types, and everything has been working great, however I’ve been trying to optimize the content for SEO within these custom post types using SEOpress and the content analysis element of this plugin doesn’t recognize the content provided in the PODs metaboxes as “content”

    Is there a way to make the pods content appear as wordpress content for the sake of other plugins? I’ve checked the Advanced Options tab and don’t see anything that is jumping out at me. That said the documentation for this section of the software doesn’t seem to be complete, so I may be misunderstanding some of the options (ie. what do the “supports” selections do? The documentation doesn’t have any information for that section.
    Would love to figure out if there’s a way I can get the custom post content to be considered as content for the greater WP ecosystem. Any suggestions?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    you will have to use this filter to add your custom fields created with PODS: https://www.seopress.org/support/hooks/filter-the-analyzed-content/

    Hope that helps!

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @taylorthain

    This is a quite difficult issue since each SEO plugin works differently and usually doesn’t check the front-end but only the admin edit page.

    I’m not familiar with SEOpress so I’m not sure but the suggestion from @rainbowgeek would probably be best in this case!

    Cheers, Jory

    Thread Starter taylorthain

    (@taylorthain)

    Hey Team! Thanks for the replies. The suggested fix from @rainbowgeek was the right direction. I actually managed to find it myself a couple hours before this reply.

    That said, for anyone else who has a similar issue or is looking to solve this problem, the hook that was provided from the SEOpress documentation has a limitation that I didn’t like, in that it required me to specify every individual content field from the custom post type if i wanted it included in the analysis. This didn’t work for me as my post type has a multitude of content blocks in the editor.

    To solve for this, I edited the code. The following code will check if a post type is the PODs custom post type and then retrieve ALL Meta fields for the post type and make it readable to the plugin.

    Just swap out ‘your_custom_post’ with the name of your post from Pods and throw this in your functions document and that content should now be visible to the Analysis Metabox!

    add_action( 'wp_enqueue_scripts', 'wpbf_child_scripts', 13 );
    // SEOpress Content Analysis Expansion - Your Custom Post Type
    function sp_content_analysis_content($content, $id) {
        // Check if the post type is 'your_custom_post'
        $post_type = get_post_type($id);
        if ($post_type === 'your_custom_post') {
            // Retrieve all meta fields for the post
            $meta_fields = get_post_meta($id);
    
            // Append the field values to the original content
            foreach ($meta_fields as $key => $value) {
                $content .= $value[0];
            }
        }
    
        return $content;
    }
    add_filter('seopress_content_analysis_content', 'sp_content_analysis_content', 10, 2);
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to get Pods Content recognized as WP Post Content’ is closed to new replies.