Instead of using all-purpose flour you can try using your preferred gluten-free flour blend. Look for a blend that is specifically designed for 1:1 substitution to ensure the best outcome. Some gluten-free flours already contain xanthan gum, which helps replicate the texture of gluten. However if your chosen blend doesn't have xanthan gum you may want to consider adding, around 1/2 teaspoon of it to the mixture. This will assist in binding the ingredients. Prevent the cookies from falling apart. Keep in mind that gluten-free flours sometimes absorb moisture so if your dough seems dry feel free to add a bit more butter to it.