Not triggering SEOMatic on save element I'm writing a module that loops over lines in a CSV file to save them as entries. For every entry I save with elements-&gt;saveElement($element);, SEOMatic will queue a job that regenerates the sitemap for this type of entries. I'm importing more than 1000 lines this way, so there'd be more than 1000 jobs in the queue, all doing the same thing.
Is there a way to disable this hook so it wouldn't get triggered for every entry?

Here's a part of the code right now:

while (($csv = fgetcsv($handle)) !== false) {
    $entry = Entry::find()-&gt;siteId($siteId)-&gt;section('products')-&gt;where(['content.field_productId' =&gt; $csv[0]])-&gt;one();

    if (!$entry) {
        $entry = new Entry();
        $entry-&gt;sectionId = Craft::$app-&gt;sections-&gt;getSectionByHandle('products')-&gt;id;
        $entry-&gt;typeId = 1;
        $entry-&gt;siteId = $siteId;
    }


    ...
    ...
    ...


    try {
        Craft::$app-&gt;elements-&gt;saveElement($entry, true, true, false);
    } catch (Throwable $e) {
        throw new RuntimeException($e);
    }
}

try {
    Craft::$app-&gt;elements-&gt;resaveElements(Entry::find()-&gt;siteId($siteId)-&gt;section('products'), false, true, true);
} catch (Throwable $e) {
    throw new RuntimeException($e);
}
By setting the regenerateSitemapsAutomatically to false, SEOMatic won't regenerate a sitemap for every entry saved.
At the end of the job, I set it back to true and save the first element inside of the same section.

Changes to the original code: 

Seomatic::$settings-&gt;regenerateSitemapsAutomatically=false; // Disable it

while (($csv = fgetcsv($handle)) !== false) {
    $entry = Entry::find()-&gt;siteId($siteId)-&gt;section('products')-&gt;where(['content.field_productId' =&gt; $csv[0]])-&gt;one();

    if (!$entry) {
        $entry = new Entry();
        $entry-&gt;sectionId = Craft::$app-&gt;sections-&gt;getSectionByHandle('products')-&gt;id;
        $entry-&gt;typeId = 1;
        $entry-&gt;siteId = $siteId;
    }


    ...
    ...
    ...


    try {
        Craft::$app-&gt;elements-&gt;saveElement($entry);
    } catch (Throwable $e) {
        throw new RuntimeException($e);
    }
}

try {
    Seomatic::$settings-&gt;regenerateSitemapsAutomatically=true; // Enable it again
    $firstElement = Entry::find()-&gt;siteId($siteId)-&gt;section('products')-&gt;one();
    Craft::$app-&gt;elements-&gt;saveElement($firstEntry); // Save first entry again
} catch (Throwable $e) {
    throw new RuntimeException($e);
}


Thanks to Oli for the suggestion.