Instant Pot BBQ Shredded Beef

Get ready to savor the ultimate comfort food with our Instant Pot BBQ Shredded Beef recipe ! This mouthwatering dish is a game-changer, combining tender, fall-apart beef infused with smoky barbecue flavor. Slab it on a toasty bun for weeknight dinner or gathering. Just set it, forget it, and let your Instant Pot do the magic!













“I just made this recipe for my husband’s Friday night fellowship group. There were a dozen hungry guys and they ate all 5 pounds of beef!. Thank you. Thank you. THANK YOU!!” – Susan










Reasons You’ll Love this Recipe




It’s EASY ! Simply season the beef and cook it in the Instant Pot with  Homemade BBQ Sauce  (or whatever your favorite store-bought brand is). 



It’s  freezer-friendly . Shredded beef is a great recipe to double and freeze before cooking. You can also fully cook it and freeze it in small portions.



It feeds a lot of people . When served on buns, this recipe can easily feed 10+ people. Here are  25+ Slow Cooker Recipes for a Crowd  if you want more idea



It’s a  Dump & Go Recipe .  We know people love those!



It can also be made in the slow cooker. Try our  Crock Pot BBQ Shredded Beef Sandwiches .






Ingredients



Only a few ingredients are needed to make this pot of melt-in-your-mouth sandwich filling.







Ingredient Notes:



BBQ Sauce – You can make homemade BBQ Sauce or use store bought.



Chuck Roast – An affordable beef cut from the shoulder, neck, and upper arm, transforms into tender, juicy perfection when cooked in the Instant Pot. Opt for grass-fed beef for better nutrition, with a healthier fat profile.





How to Make BBQ Beef in the Instant Pot



Here’s the quick and dirty overview for making shredded beef in the pressure cooker. See the recipe below for more details.



Step 1: Make dry rub with your seasonings.



Step 2: Cut meat into 2×2 inch pieces. Pat dry and toss with the seasonings in the Instant Pot.



Step 3: Pour 1 cup BBQ sauce over the top.



Step 4: Cook at high pressure for 30 minutes with a natural release.



Step 5: Shred the meat and stir back into the sauce.



Step 6: Serve the meat on toasted buns with more BBQ sauce.









How Long Do I Cook a Chuck Roast in the Instant Pot?



While researching for our cookbook, we quickly learned that there are a LOT of varying opinions on how long to cook a chuck roast in the Instant Pot.




Cut a beef chuck roast into evenly-sized smaller chunks , trimming the fat off as you go. We recommend 2 x 2 inch pieces.



Cook at high pressure for 30 minutes and then use a natural release for at least 10 minutes. After that, you can quick release the rest of the pressure.




We found that this method works well every single time . However, cooking a whole chuck roast takes at least an hour if not more to tenderize somewhat in the Instant Pot.



Even then, our roasts often weren’t very easy to shred. So we stand by the “cut your beef into small chunks first” method all day!









Pro Tips for Cooking Beef in the Instant Pot



As I mentioned, we tested this recipe A LOT for our cookbook called From Freezer to Cooker . Along the way, we learned several tips for the perfect BBQ shredded beef in the Instant Pot.




Be sure to cut your roast into evenly-sized smaller chunks. We recommend 2×2 inch pieces. This yields perfectly tender, shreddable meat at the end of 30 minutes.



Trim off as much excess fat as you can , or ask your butcher to do it for you.



You must include at least 1 cup of liquid in a 6-quart Instant Pot (and at least 1 1/2 cups of liquid to the 8-quart Instant Pot) to allow pressure to build. So, feel free to add more BBQ sauce if you have a larger pressure cooker than a 6 quart.



Serve the shredded meat on toasted buns (see our instructions in the recipe below). This prevents soggy buns…NO ONE LIKES SOGGY BUNS. Lol.
















How to Freeze BBQ Shredded Beef





BBQ Beef makes a great freezer meal . You can prep it ahead and freeze before cooking OR you can fully cook it and freeze AFTER cooking. Both options work great.


Freeze For Later: Follow steps 1 and 2. Place the seasoned meat, the beef broth, and 1 cup of the BBQ sauce in a gallon-sized freezer bag or round container. Seal, toss to combine, and freeze (if using a freezer bag, set it in a bowl or round container with a diameter similar to the Instant Pot so it will fit in the pot when frozen). Pour the remaining 1/2 cup of BBQ sauce into a small bag/container and seal. Freeze the sauce and buns alongside the meat.
Prepare From Frozen: Set the extra sauce and buns out on the counter to start thawing. Set the Instant pot to “Saute”. Transfer the frozen meat and sauce to the pot and cook for 5 minutes to release some liquid. Press “Cancel”. Follow steps 4-8 (the meat will cook at the same time length as when fresh!).





















Side Dish Ideas




























Sweet Potato Biscuits
































Crockpot Baked Apples
































5-Ingredient Coleslaw
































Microwave Corn on the Cob

































A Must Have for Instant Pot Users




Instant Pot Cooking Times Chart




After testing hundreds of Instant Pot recipes, we have honed in on the best timing and methods for cooking different types of meals in the Instant Pot.

Please enable JavaScript in your browser to complete this form.

Name *
Email *
GDPR Agreement *

I agree to receive emails from Thriving Home *







Send it my way!













FAQs



Do I have to use a chuck roast? Chuck roast is a popular choice for BBQ shredded beef due to its rich flavor and ability to become tender when slow-cooked. Other options include brisket or short ribs. Can I make BBQ Shredded Beef in advance and freeze it? Yes, you can make BBQ shredded beef ahead of time and freeze it for later use. Be sure to store it in an airtight container or freezer bag, and it should stay good for several months. What ways should I serve BBQ Shredded Beef? BBQ shredded beef is versatile and can be used in various dishes. Serve it on sandwich buns, over rice, in tacos, on nachos, or as a topping for baked potatoes. It’s a great addition to mac and cheese, too!





Did you make this? Snap a photo and tag us on Instagram at @thrivinghome so we can see your creations and cheer you on!






















★ ★ ★ ★ ★



5 from 4 reviews









Instant Pot BBQ Shredded Beef




Seasoned, tender shredded beef covered in a homemade BBQ sauce takes minutes in the Instant Pot or pressure cooker. Freezer meal instructions included.
Find our Slow Cooker BBQ Beef recipe here .








Yield: 8-10 servings







Prep: 10 minutes Cook: 60 minutes Total: 1 hour 10 minutes












Print Recipe

Rate



Pin for Later






Email













Units:

US M









Ingredients




1 teaspoon onion powder
1 teaspoon garlic powder
1 teaspoon salt
1/2 teaspoon ground black pepper
1 (approx. 3 pound) boneless beef chuck roast, trimmed of excess fat
1 1/2 cups BBQ Sauce
1 cup of beef broth (sub: chicken broth)
8 – 10 whole wheat hamburger buns








Cook Mode

Prevent your screen from going dark













Before You Begin! If you make this, please leave a review and rating letting us know how you liked this recipe! This helps our business thrive & continue providing free recipes.






Instructions




Make It Now:

In a small bowl, combine the onion powder, garlic powder, salt, and pepper.
Cut the meat into 2×2 inch pieces, trimming off excess fat as needed. Pat dry with a paper towel and rub all over with the seasonings.
Add the meat, beef broth, and 1 cup of BBQ sauce to the Instant Pot. Toss to combine.
Lock and seal the lid. Cook at high pressure for 30 minutes. Allow the pressure to naturally release for 10 minutes, then quick release the remaining pressure.
Transfer the roast to a cutting board and shred with two forks. Add the meat back to the juices in the pot to keep moist.
Position the top rack of the oven 6 inches below the broiler. Preheat the broiler.
Place the buns on a baking sheet with the insides facing up. Broil the buns for 1-2 minutes, until golden (watch them closely!).
Using a slotted spoon or tongs, top each bun with some of the meat. Spoon over some of the remaining BBQ sauce and enjoy.

Freeze For Later: Follow steps 1 and 2. Place the seasoned meat, the beef broth, and 1 cup of the BBQ sauce in a gallon-sized freezer bag or round container. Seal, toss to combine, and freeze (if using a freezer bag, set it in a bowl or round container with a diameter similar to the Instant Pot so it will fit in the pot when frozen). Pour the remaining 1/2 cup of BBQ sauce into a small bag/container and seal. Freeze the sauce and buns alongside the meat.
Prepare From Frozen: Set the extra sauce and buns out on the counter to start thawing. Set the Instant pot to “Saute”. Transfer the frozen meat and sauce to the pot and cook for 5 minutes to release some liquid. Press “Cancel”. Follow steps 4-8 (the meat will cook at the same time length as when fresh!).

















Notes/Tips





Be sure to cut your roast into evenly-sized smaller chunks. We recommend 2×2 inch pieces.








Trim off as much excess fat as you can , or ask your butcher to do it for you.








You must include at least 1 cup of liquid in a 6-quart Instant Pot (and at least 1 1/2 cups of liquid to the 8-quart Instant Pot) to allow pressure to build. 








Serve the shredded meat on toasted buns. This prevents soggy buns.













(function(){
window.addEventListener( 'message', function( event ){
if ( ( 'https://nutrifox.com' !== event.origin && 'https://nutrifox.test' !== event.origin ) ||
typeof event.data !== 'string' ) {
return;
}
var payload = JSON.parse( event.data );
switch ( payload.event ) {
case 'setHeight':
var iframe = document.getElementById( 'nutrifox-label-' + payload.recipeId );
iframe.style.height = payload.height + 'px';
break;
}
} );
}());









© Author: Rachel Tiemeyer



Cuisine:
American






Method:
Instant Pot








Did you make this?



Snap a photo and tag us on Instagram at @thrivinghome so we can see your creations and cheer you on!






















Rate Recipe
























Tag Us on Instagram























.tasty-recipes-print-button{background-color:#667;border:none;display:inline-block;padding:.5em 1em;text-decoration:none}body:not(.tasty-recipes-print-view) .tasty-recipes-print-button.tasty-recipes-print-above-card{color:#fff;display:none}body:not(.tasty-recipes-print-view) .tasty-recipes-print-button.tasty-recipes-print-above-card:hover{background-color:#b2b2bb;color:#fff;display:inline-block;padding:.5em 1em;text-decoration:none}.tasty-recipes-image-button-container{display:flex;flex-direction:column;flex-wrap:wrap;float:right;margin-left:10px}body.tasty-recipes-print-view .tasty-recipes-buttons,body.tasty-recipes-print-view .tasty-recipes-cook-mode{display:none}.tasty-recipes-image-button-container .tasty-recipes-buttons{margin-bottom:10px;margin-top:10px}.tasty-recipes-image-button-container .tasty-recipes-button-wrap{box-sizing:border-box;margin-bottom:10px}.tasty-recipes-image-button-container .tasty-recipes-buttons a{background-color:#f9f9f9;border:1px solid #aaa;border-radius:0;color:#aaa;cursor:pointer;display:block;font-size:16px;font-weight:700;line-height:16px;margin-top:0;padding:8px;text-align:center;text-decoration:none;text-transform:uppercase}.tasty-recipes-image-button-container .tasty-recipes-buttons .button:hover{background-color:#aaa;border:1px solid #aaa;color:#fff;opacity:1}.tasty-recipes-image-button-container .tasty-recipes-buttons a:hover{background-color:#979599;text-decoration:none}.tasty-recipes-image-button-container .tasty-recipes-buttons svg{display:none}.tasty-recipes-yield-scale{border:1px solid #979599;border-radius:2px;color:#979599;font-size:.7rem;margin-left:3px;padding:0 4px}.tasty-recipes-units-scale-container{display:flex;flex-wrap:wrap}.tasty-recipes-convert-container{padding:0 1em 1em 0}.tasty-recipes-convert-container .tasty-recipes-convert-label{align-self:center;color:#979599;font-size:.6rem;text-transform:uppercase}.tasty-recipes-convert-container button{background:transparent;border:1px solid #353547;border-radius:2px;color:#353547;letter-spacing:0;margin-left:5px;min-width:34px;padding:2px 4px;text-align:center}.tasty-recipes-convert-container button.tasty-recipes-convert-button-active{background-color:#000;border-color:#000;color:#fff}.tasty-recipes-convert-container button:focus{outline:none}.tasty-recipes-scale-container{display:flex;padding:0 0 1em}.tasty-recipes-scale-container .tasty-recipes-scale-label{align-self:center;color:#979599;font-size:.6rem;text-transform:uppercase}.tasty-recipes-scale-container button{background:transparent;border:1px solid #353547;border-radius:2px;color:#353547;cursor:pointer;letter-spacing:0;margin-left:5px;min-width:34px;padding:2px 4px}.tasty-recipes-scale-container button.tasty-recipes-scale-button-active{background-color:#000;border-color:#000;color:#fff}.tasty-recipes-scale-container button:focus{outline:none}.tasty-recipes-ingredients-header{margin:1em 0}@media only screen and (min-width:520px){.tasty-recipes-ingredients-header{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}}.tasty-recipes-ingredients-header .tasty-recipes-ingredients-clipboard-container{align-items:baseline;display:inline-flex}.tasty-recipes-ingredients-header h3{margin:0 10px 10px 0}.tasty-recipes-ingredients-clipboard-container .tasty-recipes-copy-button{background:transparent;border:none;color:#353547;height:24px;padding:0;position:relative;width:24px}.tasty-recipes-ingredients-clipboard-container .tasty-recipes-copy-button:hover{opacity:.5}.tasty-recipes-instructions-header{align-items:baseline;display:flex;flex-wrap:wrap;justify-content:space-between;margin:1em 0}.tasty-recipes-entry-content .tasty-recipes-instructions h3{margin:0 0 1rem}@media only screen and (min-width:520px){.tasty-recipes-entry-content .tasty-recipes-instructions h3{margin:0}}button[name=tasty-recipes-video-toggle]{background:#979599;border:#979599;border-radius:2px;display:inline-block;font-size:14px;height:30px;line-height:20px;margin:0;padding:0;text-align:center;vertical-align:middle;width:86px}button[name=tasty-recipes-video-toggle] span{padding:0 4px;pointer-events:none}button[name=tasty-recipes-video-toggle][aria-checked=false] :last-child,button[name=tasty-recipes-video-toggle][aria-checked=true] :first-child{background:#fff;border-radius:2px;color:#979599;padding:2px 4px}button[name=tasty-recipes-video-toggle][aria-checked=false] :first-child,button[name=tasty-recipes-video-toggle][aria-checked=true] :last-child{color:#fff}label[for=tasty-recipes-video-toggle]{color:#979599;font-size:.6rem;line-height:30px;padding-right:8px;text-transform:uppercase;user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;-o-user-select:none;vertical-align:middle}.tasty-recipe-responsive-iframe-container{margin:10px 0}.tasty-recipes-equipment{display:flex;flex-wrap:wrap;justify-content:space-evenly}.tasty-recipes-equipment>h3{flex:0 0 100%}.tasty-recipes-equipment .tasty-link-card{flex:0 0 50%;padding:1.5rem 1rem;text-align:center}@media screen and (min-width:500px){.tasty-recipes-equipment .tasty-link-card{flex:0 0 33%}}.tasty-recipes-equipment .tasty-link-card p{font-size:1em;font-weight:700;margin-bottom:0}.tasty-recipes-equipment .tasty-link-card p a{color:initial}.tasty-recipes-equipment .tasty-link-card span{font-size:.9em}.tasty-recipes .tasty-recipes-nutrition ul{list-style-type:none;margin:0;padding:0}.tasty-recipes .tasty-recipes-nutrition ul:after{clear:both;content:" ";display:block}.tasty-recipes .tasty-recipes-nutrition li{float:left;list-style-type:none;margin-bottom:0;margin-left:0;margin-right:16px}.tasty-recipes-plug{align-items:center;display:flex;flex-wrap:wrap;justify-content:center;margin-bottom:1em;text-align:center}.tasty-recipes-plug a{box-shadow:none;text-decoration:none}.tasty-recipes-plug a img{background:transparent;box-shadow:none;display:inline-block;height:auto;margin:5px 0 0 8px;padding:0;width:150px}.tasty-recipes-footer-content{padding:1.5em;text-align:center}.tasty-recipes-footer-content .tasty-recipes-footer-copy{margin-left:0}.tasty-recipes-footer-content img,.tasty-recipes-footer-content svg{width:60px}.tasty-recipes-entry-content .tasty-recipes-entry-footer h3{font-size:1.25em;margin:0 0 .25em;padding:0}.tasty-recipes-entry-footer p{font-size:.75em;margin:0}.tasty-recipes-entry-footer p a{border-bottom:none;box-shadow:none;text-decoration:underline}.tasty-recipes-flash-message{background-color:#fff;border-radius:4px;box-shadow:0 .3px .4px 0 rgba(0,0,0,.024),0 .9px 1.5px 0 rgba(0,0,0,.05),0 3.5px 6px 0 rgba(0,0,0,.1);color:#313135;display:inline-block;font-size:13px;letter-spacing:0;line-height:1.2em;margin-left:10px;padding:4px 10px}@media screen and (min-width:500px){.tasty-recipes-flash-message{padding:4px 10px}}.tasty-recipes-flash-message p{margin:0;padding:0;text-transform:none}@media screen and (min-width:500px){.tasty-recipes-footer-content{align-items:center;display:flex;justify-content:center;padding:1.5em 0;text-align:left}.tasty-recipes-footer-content .tasty-recipes-footer-copy{margin-left:.8em}}@media print{.tasty-recipes-no-print,.tasty-recipes-no-print *{display:none!important}}[data-tr-ingredient-checkbox]{cursor:pointer;list-style-position:outside;list-style-type:none!important;margin-left:0!important}[data-tr-ingredient-checkbox] .tr-ingredient-checkbox-container{position:relative}[data-tr-ingredient-checkbox] .tr-ingredient-checkbox-container input[type=checkbox]+label{display:inline-block;position:relative;vertical-align:middle}[data-tr-ingredient-checkbox] .tr-ingredient-checkbox-container input[type=checkbox]{clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px);height:1px;overflow:hidden;position:absolute!important;width:1px}[data-tr-ingredient-checkbox] .tr-ingredient-checkbox-container input[type=checkbox]+label:before{border:1px solid;border-radius:2px;content:"";display:inline-block;height:20px;margin-right:10px;position:relative;width:20px}[data-tr-ingredient-checkbox] .tr-ingredient-checkbox-container input[type=checkbox]:checked+label:after{border-bottom:2px solid;border-left:2px solid;content:"";display:inline-block;height:6px;left:4px;position:absolute;top:4px;transform:rotate(-45deg);width:12px}[data-tr-ingredient-checkbox] .tr-ingredient-checkbox-container input[type=checkbox]:focus+label:before{box-shadow:0 0 8px #5e9ed6;outline:1px solid #5d9dd5}[data-tr-ingredient-checkbox=checked]{opacity:.8;text-decoration:line-through}.tasty-recipes-cook-mode__container{align-items:center;display:flex;line-height:100%}.tasty-recipes-cook-mode__container label{font-size:inherit}.tasty-recipes-cook-mode__switch{display:inline-block;height:17px;margin-right:10px;position:relative;width:30px}.tasty-recipes-cook-mode__switch-slider{background-color:#737373;bottom:0;cursor:pointer;display:block;left:0;opacity:.4;position:absolute;right:0;top:0;transition:.4s}.tasty-recipes-cook-mode__switch-slider:before{background-color:#fff;bottom:2px;content:"";height:13px;left:2px;position:absolute;transition:.4s;width:13px}.tasty-recipes-cook-mode__switch input{display:none}.tasty-recipes-cook-mode__switch input:checked+span{opacity:1}.tasty-recipes-cook-mode__switch input:checked+span:before{transform:translateX(13px)}.tasty-recipes-cook-mode__switch-round{border-radius:34px}.tasty-recipes-cook-mode__switch-round:before{border-radius:50%}.tasty-recipes-cook-mode__label{font-weight:700}



window.tasty_recipes_min_rating = 4;
(function(){


var bothEquals = function( d1, d2, D ) {
var ret = 0;
if (d1 d2)d2=D+1;else d1=D+1;break}else if(x D){d1=d2;n1=n2}if(!mixed)return[0,n1,d1];var q=Math.floor(n1/d1);return[q,n1-q*d1,d1]};frac.cont=function cont(x,D,mixed){var sgn=x D){if(Q_1>D){Q=Q_2;P=P_2}else{Q=Q_1;P=P_1}}if(!mixed)return[0,sgn*P,Q];var q=Math.floor(sgn*P/Q);return[q,sgn*P-q*Q,Q]};


window.tastyRecipesVulgarFractions = JSON.parse(decodeURIComponent("%7B%22%C2%BC%22%3A%221%2F4%22%2C%22%C2%BD%22%3A%221%2F2%22%2C%22%C2%BE%22%3A%223%2F4%22%2C%22%E2%85%93%22%3A%221%2F3%22%2C%22%E2%85%94%22%3A%222%2F3%22%2C%22%E2%85%95%22%3A%221%2F5%22%2C%22%E2%85%96%22%3A%222%2F5%22%2C%22%E2%85%97%22%3A%223%2F5%22%2C%22%E2%85%98%22%3A%224%2F5%22%2C%22%E2%85%99%22%3A%221%2F6%22%2C%22%E2%85%9A%22%3A%225%2F6%22%2C%22%E2%85%9B%22%3A%221%2F8%22%2C%22%E2%85%9C%22%3A%223%2F8%22%2C%22%E2%85%9D%22%3A%225%2F8%22%2C%22%E2%85%9E%22%3A%227%2F8%22%7D"));

window.tastyRecipesFormatAmount = function(amount, el) {
if ( parseFloat( amount ) === parseInt( amount ) ) {
return amount;
}
var roundType = 'frac';
if (typeof el.dataset.amountShouldRound !== 'undefined') {
if ('false' != el.dataset.amountShouldRound) {
if ( 'number' === el.dataset.amountShouldRound ) {
roundType = 'number';
} else if ('frac' === el.dataset.amountShouldRound) {
roundType = 'frac'
} else if ('vulgar' === el.dataset.amountShouldRound) {
roundType = 'vulgar'
} else {
roundType = 'integer';
}
}
}
if ('number' === roundType) {
amount = Number.parseFloat(amount).toPrecision(2);
} else if ('integer' === roundType) {
amount = Math.round(amount);
} else if ('frac' === roundType || 'vulgar' === roundType) {
var denom = 8;
if (typeof el.dataset.unit !== 'undefined') {
var unit = el.dataset.unit;
if (['cups','cup','c'].includes(unit)) {
denom = 4;
if (0.125 === amount) {
denom = 8;
}
if ("0.1667" === Number.parseFloat( amount ).toPrecision(4)) {
denom = 6;
}
}
if (['tablespoons','tablespoon','tbsp'].includes(unit)) {
denom = 2;
}
if (['teaspoons','teaspoon','tsp'].includes(unit)) {
denom = 8;
}
}
var amountArray = frac.cont( amount, denom, true );
var newAmount = '';
if ( amountArray[1] !== 0 ) {
newAmount = amountArray[1] + '/' + amountArray[2];
if ('vulgar' === roundType) {
Object.keys(window.tastyRecipesVulgarFractions).forEach(function(vulgar) {
if (newAmount === window.tastyRecipesVulgarFractions[vulgar]) {
newAmount = vulgar;
}
});
}
}
if ( newAmount ) {
newAmount = ' ' + newAmount;
}
if ( amountArray[0] ) {
newAmount = amountArray[0] + newAmount;
}
amount = newAmount;
}
return amount;
}


window.tastyRecipesUpdatePrintLink = () => {
const printLinks = document.querySelectorAll( '.tasty-recipes-print-link' );
const printButtons = document.querySelectorAll( '.tasty-recipes-print-button' );

// Use the first print button found as the canonical URL source.
const printButton = document.querySelector( '.tasty-recipes-print-button' );

// If no print button is available, we can't reliably update its href.
if ( ! printButton ) {
return;
}

const printURL = new URL( printButton.href );
const searchParams = new URLSearchParams( printURL.search );

const unitButton = document.querySelector( '.tasty-recipes-convert-button-active' );
const scaleButton = document.querySelector( '.tasty-recipes-scale-button-active' );

let unit = '';
let scale = '';

if ( unitButton ) {
unit = unitButton.dataset.unitType;
searchParams.delete('unit');
searchParams.set( 'unit', unit );
}

if ( scaleButton ) {
scale = scaleButton.dataset.amount;
searchParams.set( 'scale', scale );
}

const paramString = searchParams.toString();
const newURL = '' === paramString ? printURL.href : printURL.origin + printURL.pathname + '?' + paramString;

printLinks.forEach( ( el ) => {
el.href = newURL;
});

printButtons.forEach( ( el ) => {
el.href = newURL;
});
}

// When the document loads, look for unit and scale parameters and setup the recipe card
// to reflect those values.
document.addEventListener( 'DOMContentLoaded', () => {

// Only reflect URL parameters on the print view.
if ( ! window.location.href.includes( '/print/' ) ) {
return;
}

const searchParams = new URLSearchParams( window.location.search );

const unit = searchParams.get( 'unit' );
const scale = searchParams.get( 'scale' );

if ( unit && ( 'metric' === unit || 'usc' === unit ) ) {
document.querySelector( '.tasty-recipes-convert-button[data-unit-type="' + unit + '"]' ).click();
}

if ( scale && Number(scale) > 0 ) {
document.querySelector( '.tasty-recipes-scale-button[data-amount="' + Number(scale) + '"]' ).click();
}
});
}());

(function(){
var buttonClass = 'tasty-recipes-convert-button',
buttonActiveClass = 'tasty-recipes-convert-button-active',
buttons = document.querySelectorAll('.tasty-recipes-convert-button');
if ( ! buttons ) {
return;
}
buttons.forEach(function(button){
button.addEventListener('click', function(event){
event.preventDefault();
var recipe = event.target.closest('.tasty-recipes');
if ( ! recipe ) {
return;
}
var otherButtons = recipe.querySelectorAll('.' + buttonClass);
otherButtons.forEach(function(bt){
bt.classList.remove(buttonActiveClass);
});
button.classList.add(buttonActiveClass);
var unitType = button.dataset.unitType;
var dataset = 'nf' + unitType.charAt(0).toUpperCase() + unitType.slice(1);
var convertables = recipe.querySelectorAll('span[data-nf-original]');
convertables.forEach(function(convertable){
if (typeof convertable.dataset.amountOriginalType === 'undefined'
&& 'usc' === convertable.dataset.nfOriginal) {
if (-1 !== convertable.innerText.indexOf('/')) {
convertable.dataset.amountOriginalType = 'frac';
}
if (-1 !== convertable.innerText.indexOf('.')) {
convertable.dataset.amountOriginalType = 'number';
}
Object.keys(window.tastyRecipesVulgarFractions).forEach(function(vulgar) {
if (-1 !== convertable.innerText.indexOf(vulgar)) {
convertable.dataset.amountOriginalType = 'vulgar';
}
});
}
convertable.innerText = convertable.dataset[dataset];
if (typeof convertable.dataset.unit !== 'undefined') {
convertable.dataset.unit = convertable.dataset[dataset + 'Unit'];
}
if (typeof convertable.dataset.amount !== 'undefined') {
convertable.dataset.amount = convertable.dataset[dataset];
if ('metric' === unitType) {
convertable.dataset.amountShouldRound = parseInt(convertable.dataset.amount) >= 10 ? 'integer' : 'number';
} else if (typeof convertable.dataset.amountOriginalType !== 'undefined') {
convertable.dataset.amountShouldRound = convertable.dataset.amountOriginalType;
} else {
convertable.dataset.amountShouldRound = false;
}
convertable.innerText = window.tastyRecipesFormatAmount(convertable.dataset[dataset], convertable);
}
if (convertable.classList.contains('nutrifox-unit')) {
if ('gram' === convertable.dataset[dataset]) {
convertable.innerText = 'grams';
}
}
});

document.querySelectorAll('.tasty-recipes-scale-button-active').forEach(function(scaleButton){
scaleButton.click();
});

window.tastyRecipesUpdatePrintLink();
});
});
}());

(function(){
document.qu