You must find the name of the enqueued stylesheet in your theme and use it to dequeue a style – wp_dequeue_style. URL is unnecessary.
Example:
function remove_unwanted_css() {
wp_dequeue_style( 'font-awesome' );
}
add_action( 'wp_print_styles', 'remove_unwanted_css', 100 );
Or another solution wp_deregister_style/:
add_action( 'wp_enqueue_scripts', 'remove_default_stylesheet', 20 );
function remove_default_stylesheet() {
wp_dequeue_style( 'font-awesome' );
wp_deregister_style( 'font-awesome' );
wp_register_style( 'new-font-awesome', get_stylesheet_directory_uri() . '/new.css', false, '1.0.0' );
wp_enqueue_style( 'new-font-awesome' );
}
Related Posts:
- I can’t seem to install Font Awesome locally [closed]
- How to remove font awesome from loading in wp theme
- Including Font Awesome in a Custom Theme
- Will dequeueing in child theme functions.php file prevent Google Fonts from loading?
- How to automatically load Google Fonts on pages only as they’re used?
- 400 bad request on admin-ajax.php only using wp_enqueue_scripts action hook
- How long does a deprecated function live in core?
- Memorizing syntax
- Custom page with variables in url. Nice url with add_rewrite_rule
- remove links from images using functions.php
- Extract image from content and set it as the featured image
- functions.php inject inline css
- How to add css class to cloud tag anchors?
- Variable scope in WordPress functions.php
- Removing custom background and header feature in child theme
- How to enqueue every script in a folder automatically?
- what is the use of esc_attr() function?
- override parent theme configuration in child functions.php
- How to display error messages using WP_Error class?
- How to prevent deleting of comments when deleting a post
- which is the function that removes accented vowels?
- List repeating share links
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Function in Child Theme not overriding Parent Theme function [duplicate]
- Php string not working in WordPress Functions.php (trying to fetch 1st category for each blog that post appears in the sidebar)
- How to save Uploaded image in custom option panel?
- How to integrate owl carousel into theme without using a plugin?
- WordPress function/template tag to get first n words of the content
- My function doesn’t work into WordPress but outside, it works – what am I missing?
- Allow latex in wordpress excerpt
- Pages should have priority when using add_rewrite_rule
- Setting cookies in WordPress
- How to add iOS & fav icons to the theme?
- Defer all js except certain ones in functions.php file
- Getting RID of thickbox!
- Automatically insert php function into post $the_content
- Create dropdown of users in admin dashboard
- Multisite, either change the name of sample-page or create new page
- How to use thumbnails in gallery?
- How to display a default image for post thumbnail using functions.php?
- How can I load a javascript file that is type=”module” the WordPress way?
- How to manage arrays from custom functions stored in functions.php?
- wp_trash_post function to only apply to posts, not pages!
- Adding widget to dashboard with wp_dashboard_setup not working
- Using Schema with `the_excerpt`
- Image rotation fails to regenerate custom sized thumbnail
- Register and load scripts
- Having a Function Inside of the Loop
- About cron delete user with meta_key
- Unable to login using username
- How to change the order of Jquery in the footer of my theme?
- media resize/crop possibilities?
- adding custom script to functions file
- edit formatting.php in a theme so it wont get overwritten
- Hook into a function without a hook?
- add_action template_redirect not working for home page
- Way to store featured image width and height in two separate variables?
- Insert template-part inside the content
- Add unique id to Preview URL
- Numbering lines of code with the tag?
- Latest Foursquare Checkin function
- Insert nofollow in a “Powered By” link, except in the homepage [closed]
- Way to redirect all Product Sub Category to its Main category Page?
- what is best way to keep track of changes made in wordpress website? [closed]
- Is this an acceptable practice for WordPress theme development?
- How to use parent theme functions in child theme functions.php file?
- How to change a specific admin label
- Custom image sizes showing in Classic Editor only when upladed directly to post
- How to add extra value to permalink
- Bulk updating a group of WordPress Pages every 10 minutes
- remove_filter function to unhook twentysixteen parent theme function
- Can we have conditional CSS styling?
- Allow logged in user to view a Page, else send to login screen and then redirect back to Page
- How to add javascript code into Divi child theme?
- Override plugin function to show invoices even if not logged in
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- ACF Filter return value
- How to build two WordPress site using two different themes with same database (No ! I am not taking about multisite network)?
- Why am I losing image quality on my site?
- Replace image attributes for lazyload plugin on image elements with specific class
- Custom shortcode with do_shortcode and substr
- Keep js after reload the page
- Add array of category IDs to global variable?
- Need some Tweak my nextpage Function
- Adding custom field in menu options [duplicate]
- Function the_content
- Edit TinyMCE Button Functionality
- WordPress Translate Explaination
- functions.php / replacing div’s with new ones?
- Excerpt – First Sentence & Read More
- Show stuff everywhere except single post?
- Replace & with &
- Decimal stripped from metabox number
- Is storing in a variable the result of a fonction a most powerful way to code an if structures in WordPress?
- Get all users from role and add to dropdown (select) – wordpress, javascript
- woocommerce_sort_product_tabs() expects an array
- Add functionality to block comment authors in the Comment edit pag
- WordPress enque the same script causes the setInterval not to work
- Customizer cuistom CSS Priority ordre Issue
- WPDB query suddenly not working