Allow ability to edit the logo/image for software application

#20200
  • Resolved Quratulain Habib
    Rank Math free

    Hi,

    I used the Software application rich schema type today. Its great because its simple ! However, i do have a couple of issues with it.

    First is, that I cannot seem to edit the image that is displayed with the review. I would like the option to use my own image instead of the default Featured image. It would be great if you showed me a way to get around this by disabling the image from showing and allowing for this in future update.

    Second, is there a way to mark the review on the side or show it with a background etc.? That way it just stands out.

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

    Thank you for contacting Rank Math today.

    The schema will pick the featured images by default but you can use the following code in your functions.php file to assign a custom image to the schema:

    /**
     * Filter to modify Software Application schema
     *
     * @param array $entity Snippet Data
     * @return array
     */
    add_filter( 'rank_math/snippet/rich_snippet_software_entity', function( $entity ) {
            global $post;
            if($post->ID =='123'){ //target certain post id
    	$entity['image']['url'] = 'https://domain.com/image.jpg';
                return $entity;
            }
            return $entity;
    });

    You can use the class name “rank-math-review-data” to create some custom CSS to style the shortcode output data.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hi Michael,

    Thanks for the sharing the code. I’m guessing I would need to specify this for all posts on my site where i want to use another image?

    If yes, can you send me a revised quote for 3 posts? I want to make sure, future edits are covered.

    At this point i have less than 15 posts with reviews attached to them and i want to remove the extra review plugin from my site to cater to those 15…

    Also, please share the name for ‘Product’ schema type. I may have to use those in a couple of instances.

    Thanks again. Youre a life saver…

    Hello,

    Thank you for contacting Rank Math today.

    Here is a revised version for 3 posts:

    /**
     * Filter to modify Software Application schema
     *
     * @param array $entity Snippet Data
     * @return array
     */
    add_filter( 'rank_math/snippet/rich_snippet_software_entity', function( $entity ) {
            global $post;
            if($post->ID =='123'){ //target certain post id
    	$entity['image']['url'] = 'https://domain.com/image.jpg';
                return $entity;
            }elseif($post->ID =='234'){ //target certain post id
    	$entity['image']['url'] = 'https://domain.com/image2.jpg';
                return $entity;
            }elseif($post->ID =='456'){ //target certain post id
    	$entity['image']['url'] = 'https://domain.com/image.jpg';
                return $entity;
            }else($post->ID =='789'){ //target certain post id
    	$entity['image']['url'] = 'https://domain.com/image.jpg';
                return $entity;
            }
            return $entity;
    });

    The last request is not very clear, would you like to modify the image for the product schema as well?

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘Allow ability to edit the logo/image for software application’ is closed to new replies.