Blogger's MIME Type error is breaking product prices. Here's what changed

If you're using Collective template and getting an error when trying to save a post with a product link in the enclosure field, here's how to fix it

Recently, Blogger started validating enclosure URLs more strictly. It now only accepts direct media file URLs, such as .mp3 or .mp4 files. If you enter a regular webpage URL that Blogger doesn't recognize, like a product page, Blogger will trigger the "invalid MIME type" error and prevent the post from being saved.

Unfortunately, this change affects the pricing system used in the Collective template. The good news? Your existing product listings are probably still fine. You'll only need to make a small adjustment going forward.

Let's walk through what changed and how to fix it.

Step 1: Find This Code 

Search for: 

<div data-sticky_parent='' expr:class='"clearfix post-wrapper post-" + data:post.id'>

Replace it with:

<div data-sticky_parent='' expr:class='"clearfix post-wrapper post-" + data:post.id' expr:data-title-link='data:post.link'>

Step 2: Add the Script

Scroll all the way down to the bottom of your theme HTML and paste the following script just before the closing </body> tag:

<script>
  //<![CDATA[

  (function() {
    function getStoreName(url) {
      try {
        var hostname = new URL(url).hostname.replace(/^www\./, '');
        var parts = hostname.split('.');
        var name = parts.length >= 2 ? parts[parts.length - 2] : parts[0];
        return name.charAt(0).toUpperCase() + name.slice(1);
      } catch (e) {
        return 'Store';
      }
    }

    function getCleanURL(url) {
      try {
        var u = new URL(url);
        u.searchParams.delete('item_price');
        u.searchParams.delete('item_currency');
        return u.searchParams.toString() === ''
          ? u.origin + u.pathname
          : u.toString();
      } catch (e) {
        return url;
      }
    }

    function getPriceData(url) {
      try {
        var u = new URL(url);
        var price = u.searchParams.get('item_price');
        var currency = u.searchParams.get('item_currency');
        if (!price) return null;
        return { price: price, currency: currency || '' };
      } catch (e) {
        return null;
      }
    }

    var body = document.body;

    // --- SINGLE POST ---
    if (body.classList.contains('post-view')) {
      var metaInner = document.querySelector('.post-meta-inner');
      if (!metaInner) return;

      var summaryEl = metaInner.querySelector('.post-summary');
      var postWrapper = document.querySelector('.post-wrapper');
      var titleLinkURL = postWrapper ? postWrapper.getAttribute('data-title-link') : null;
      if (!titleLinkURL) return;

      var data = getPriceData(titleLinkURL);
      if (!data || !summaryEl) return;

      var cleanURL = getCleanURL(titleLinkURL);
      var storeName = getStoreName(cleanURL);
      var formatted = data.currency + data.price;

      var priceEl = document.createElement('p');
      priceEl.className = 'price label';
      priceEl.innerHTML = '<strong>' + formatted + '</strong>';
      metaInner.insertBefore(priceEl, summaryEl);

      var buyWrapper = document.createElement('div');
      buyWrapper.className = 'label buybutton';
      buyWrapper.innerHTML =
        '<a class="button buynow" href="' + cleanURL + '" target="_blank">' +
          '<span>' +
            '<i class="source-label">Buy on </i>' +
            '<i class="source-store">' + storeName + '</i>' +
          '</span>' +
        '</a>';
      summaryEl.parentNode.insertBefore(buyWrapper, summaryEl.nextSibling);
    }

    // --- MULTIPLE ITEMS ---
    if (body.classList.contains('homepage-view')) {
      var postWrappers = document.querySelectorAll('.post-outer .post .post-wrapper');
      postWrappers.forEach(function(wrapper) {
        var titleLinkURL = wrapper.getAttribute('data-title-link');
        if (!titleLinkURL) return;

        var data = getPriceData(titleLinkURL);
        if (!data) return;

        var titleEl = wrapper.querySelector('.post-title.entry-title');
        if (!titleEl) return;

        var formatted = data.currency + data.price;
        var priceSpan = document.createElement('span');
        priceSpan.className = 'price';
        priceSpan.textContent = formatted;
        titleEl.parentNode.insertBefore(priceSpan, titleEl.nextSibling);
      });
    }

  })();

  //]]>
</script>

Hit save. That's the template side sorted.

Step 3: How to add pricing to posts

Instead of pasting a URL into the enclosure field, add your product link directly into the post's Title Link field (under Post Settings → Links on the right side of the editor) with two parameters: item_price and item_currency.

Example:

https://www.amazon.com/your-product?item_price=29.99&item_currency=$

A few real-world examples for different currencies:

United States ?item_price=29.99&item_currency=$
Indonesia ?item_price=299.000&item_currency=Rp
European Union ?item_price=27&item_currency=€
Japan ?item_price=12000&item_currency=¥

The template reads those parameters, strips them from the visible buy button link, and displays the price and store name automatically. Your visitors click through to a clean product URL — no extra parameters showing up on the destination page.

Wrapping Up

While the update breaks the old pricing method, the new parameter-based approach is actually more flexible and avoids future MIME Type validation problems.

If your existing product listings are already working, there's no need to rush into updating them. Simply use the new method for future posts or whenever you edit an existing product entry.

If you run into any issues after applying the fix, feel free to reach out here and I'll be happy to help.

Found a typo or error in this article? Let us know here and we’ll get it fixed ✅