skip to Main Content

screenshot of the fetchpriority attr

As we can see the fetchpriority attribute is being used although I didn’t apply that. I am using the WP rocket. As I know there is no fetchpriority option on WP rocket rocket. Seems like I am unable to find the culprit.

Maybe this feature comes default by WordPress. But I not sure as I didn’t find any relevent informations.

Note: This is a elementor site.

I just want to know, is the fetchpriority feature is a default feature or not.
if yes, how do I remove them by hook or something else.

2

Answers


  1. fetchpriority is not a default attribute in WordPress, Elementor, or WP Rocket. WordPress does not include this attribute by default in its core, nor does WP Rocket or Elementor.

    The presence of such an attribute might be due to a third-party plugin maybe.

    If you want to remove your attribute from the image you can create a custom function for this

    function remove_fetchpriority($content) {
        $content = preg_replace('/<img(.*?)fetchpriority="(.*?)"(.*?)>/', '<img$1$3>', $content);
        return $content;
    }
    add_filter('the_content', 'remove_fetchpriority');
    
    Login or Signup to reply.
  2. Felix Arntz and the rest of the WordPress core performance team implemented a big optimization in 6.3. It is written up here and does use fetchpriority.

    Its purpose is to improve time to largest contentful paint (LCP).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search