Support » Fixing WordPress » Magnet Links Not Working

  • Resolved Sim Architect

    (@thesimarchitect)


    Magnet Links don’t work anymore. Whenever I save them they look good, then when opening the page they’re converted to something useless and completely different.

    Same issue even after editing in HTML mode.

    Both Classic and Gutemberg Editors, no matter where you place an <a> tag.

    ==========

    Found a solution, you need to add support for the magnet protocol (or any other you need) manually by using the “Plugin Editor” plugin and adding the lines below:

    /**
     * Add extra protocols to list of allowed protocols.
     *
     * @param array $protocols List of protocols allowed by default by WordPress.
     *
     * @return array $protocols Updated list including extra protocols added.
     */
    function wporg49937_add_more_protocols( $protocols ){
    	$protocols[] = 'magnet';
    	return $protocols;
    }
    add_filter( 'kses_allowed_protocols' , 'wporg49937_add_more_protocols' );

    Source of the code: https://core.trac.wordpress.org/ticket/49937

  • The topic ‘Magnet Links Not Working’ is closed to new replies.