• Buenas tardes,

    Al realizar la validación de los datos estructurados en la versión AMP me da error con el logo del publisher, teniendo en cuenta esto, me gustaría que me dijeran donde encuentro las líneas de código para borrar por completo los datos estructurados que ofrece el plugin.

    Muchas gracias.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thanks for your topic!

    To confirm, is this the error that you’re seeing in the structured data testing tool: https://jmp.sh/EGec2O7 ?

    You can use this filter to remove the plugin’s default structured data:

    add_filter( 'amp_schemaorg_metadata', '__return_empty_array' );

    It also looks like you’re using the Newspaper theme and its mobile theme’s AMP templates. You might need to contact tagDiv theme support for assistance with removing the structured data specifically for their templates.

    Thread Starter Duber

    (@uribeduber)

    Muchas gracias por la respuesta, pero los datos estructurados que intento eliminar son los del plugin, que vienen por defecto como BlogPosting.

    @uribeduber thanks for your reply and the additional information. We were able to identify the error and have worked on a fix for the next release for the AMP plugin’s structured data.

    If you’d like to apply the fix now, here is the filter to do so:

    add_filter(
    	'amp_schemaorg_metadata',
    	function ( $data ) {
    		if ( isset( $data['publisher']['logo'] ) && is_string( $data['publisher']['logo'] ) ) {
    			$data['publisher']['logo'] = [
    				'@type' => 'ImageObject',
    				'url'   => $data['publisher']['logo'],
    			];
    		}
    		return $data;
    	}
    );
    

    For the Newspaper theme, you may need to use a custom plugin for it to apply to its templates (the same goes for the previous filter to remove the BlogPosting structured data).

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

The topic ‘Error logo datos estructurados’ is closed to new replies.