You use upload_mimes filter to restrict the image type as :
add_filter('upload_mimes','restict_image_type');
function restict_image_type($mimes) {
$mimes = array(
'jpg|jpeg|jpe' => 'image/jpeg',
'gif' => 'image/gif',
'png' => 'image/png',
);
return $mimes;
}
For upload limit you can set in .htaccess one of the following;
LimitRequestBody 1048576 //( 1MB)
php_value upload_max_filesize 1M
php_value post_max_size 1M
Related Posts:
- How to upload images from wordpress front-end (the first image must be thumbnail and the rest without first must be in gallery woocommerce product)
- (Woocommerce) How to add a custom page between cart and checkout with a file upload field per product item in the cart?
- Images not uploading on product page of woocommercr
- How to solve `Error getting remote image` in woocommerce rest api script?
- Limit image resolution on upload file for specific field
- WordPress pointing animated GIF images with wrong file name upon upload (GIFs animation not working)
- Adding Transaction-Specific Conversion Tracking from Adwords into WooCommerce
- New field on checkout is shown but it’s not saved on the order details [closed]
- Remove “?add-to-cart=product-id” from Add to Cart URL when on the Cart page
- How to show total amount on woocommerce?
- Changing a text label into an image
- Custom Price for WooCommerce [closed]
- Woocommerce altered my homepage, and I can’t figure out how to revert it [closed]
- Disable Order Review Page when the id product
- Set both meta_query and tax_query using wp_query->set
- Is there a preset CSS class when shopping cart isn’t empty?
- How to translate text in function.php with WPML [closed]
- Woocommerce product options [closed]
- WordPress SMS API integration without plugin error
- Absolute search against wordpress api
- Is it possible to remove editor from a custom product type?
- Setting WooCommerce SKU programmatically [closed]
- How to edit mobile view of my wordpress website without affecting the desktop view? [closed]
- Code specific for specific products
- Change Firstname & Lastname order in the order-processing e-mail templates
- WooCommerce: How to insert filtered attribute(s) in page title of archive?
- /page/ is not working with a custom permalink structure (WooCommerce)
- WooCommerce Bookings Plugin Not Saving Order ID
- Multiple Pricing [closed]
- WOOF product filter prevent from loading on wordpress search result page
- Checking page before applying image restrictions while uploading
- Trying to run Javascript on AJAX call
- Rewrite rules for sub category (child product categry & grand-child)
- Woocommerce show field in product if product-tag is “VET” else hide
- How to make a “subtitle” for each Woocommerce product
- Create Product with Woocommerce API, but Variations are not linked
- How to select the first product variant as a default?
- WooCommerce – dynamically loading checkout page using ajax not showing payment methods for guest
- Two Filter Issue [closed]
- Show notice to user based on User Meta
- How to increase media image scale limit?
- Google Analytics gtag code messes up woocommerce cart & login
- Woocommerce API security concerns
- How to add a wrapper element on image for products page
- Dynamic subdomains for woocommerce affiliate sales but NO multisite. Is that possible?
- Pass values to ajax
- Send Email to Custom Field in Custom Post Type when order is Completed
- Fragments to Update Cart Counter not working on homepage – Woocommerce
- WooCommerce Review Author Hook on Review Submission
- woocommerce ad custom button with custom link after add to cart for every product
- I wan redirect link post search to search product woocommerce?
- Woocommerce pagination problem- page/2 = 404 solution
- Woocommerce , how to set billing_address via JS?
- Filter orders in Admin area based on logged in user
- Exclude Specific Product Category for showing up in its parent category page
- How to fire a disabled WooCommerce New Order notification?
- Set up PayPal with wrong email by mistake
- Does WP-WooC support filters at database?
- How to send welcome email once user buys the subscription
- Removed Sidebar in single product page
- Reorder PRODUCTS in categories Woo
- Enable Payment gateway if ACF checkbox in user profile is checked
- Woocommerce section name? [closed]
- how to change value return by _stock_status
- Retrieve Woocommerce Cart Url with javascript/jquery [closed]
- Tags pages for different Custom Post Types and WooCommerce Products sharing Post Tags
- woocommerce_email_recipient_new_order not triggered
- Load custom post template
- get_posts only getting most recent product
- How to only show featured products in wooCommerce using function.php function
- How to insert link, with lightbox, that opens specific page content only
- Remove plugin function and add it back in via functions.php
- deactivate product-page image slider on mobile
- Custom excerpt length WooCommerce product
- Woocommerce hidding pages
- how to get woocommerce product id by acf field in wordpress and display product
- WordPress Woocommerce – Checkout – Error 405: Unable to create order. Please try again [closed]
- WooCommerce and Theme templates
- WooCommerce Hook after Billing form completed, but before payment Gateway
- PHP Warning: Error while sending QUERY packet
- Add category description on product page (Woocommerce)
- Hide .woocommerce-price-suffix on the product list page
- Woocommerce cart displays outdated prices [closed]
- Creating a shortcode with a variable (Woocommerce)?
- Woocommerce: Making email clickable [closed]
- Add field to category woocommerce page
- WordPress Pagination products with AJAX
- How to fetch More Offers products in WooCommerce?
- How do I use a combination of switch_to_blog() and wc_create_order()?
- Not showing correct number of product after using sort [closed]
- Woocommerce template not working on newly added products
- Woocommerce ajax search can’t work on mobile
- Export Woocomerce Image Product URL
- Reposition variation stock message
- Is it possible to extract all product columns except for one?
- Changing the all filename field of WooCommerce products
- My account page, don’t show the complete “Registration form”
- Woocommerce product not responsive
- limit all products
- Pricing Rules plugin bulk table not showing in varition of products (have 2 attributes) if single attribute its shows