so you need to make sure you are using the hook “admin_enqueue_scripts”. this only loads the script on the admin side.
admin_enqueue_scripts is the proper hook to use when enqueuing scripts and styles that are meant to be used in the administration panel. Despite the name, it is used for enqueuing both scripts and styles.
you can find more about the function here https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/
Hope this was helpful.
Related Posts:
- What are the common security flaws I need to look for? [closed]
- WordPress Capabilities: edit_user vs edit_users
- Where should my plugin POST to?
- Security error WP 4.0 + WP phpBB Bridge [closed]
- Should I use RIPS tool to test my themes and plugins?
- Escape when echoed
- wp_create_nonce function doesn’t work inside a plugin?
- I should enable automatic updates?
- How to prevent plugins from sniffing/stealing other plugins’ options?
- Security of a WordPress Plugin
- Help to Create a Simple Plugin to make a post
- Content-Security-Policy implementation with WordPress W3Total Cache plugin installed
- Securing a plugin pop-up window
- wp_verify_nonce fails always
- Validating values using Settings API?
- Loading external page template and enqueue script from plugin causes 403 forbidden error
- Where the Nickname is being used in WordPress
- WordPress plugin from own server
- How to avoid plugin name conflicts from the upgrade notifier?
- Is their any way to Extend WPDB class and Overwrite the Default Query Function
- Add content to /wp-admin/plugin-install.php admin screens
- How to check plugins for malicious code?
- How to properly secure my WordPress installation?
- How do I only load a plugin js on it’s settings pages?
- Need a function for changing saved post_date or post_date_gmt to relative time in wordpress
- Activate Plugin which is in subfolder?
- Adding dynamic section to WordPress
- Use functionality of 2 wordpress plugins
- Autoload via composer in plugin interference
- Add Fields with Sub-Fields to WP Job Manager
- template_redirect not being called when using ajax
- Can WordPress plugins “Talk to each other”?
- How do I store information in a dynamic block in WordPress?
- How to correctly detect accessing wp-content/uploads?
- How to create custom embed block in gutenberg wordpress
- Plugin exceeds memory limit
- Find the URL of the current plugin directory
- How can sanitize $_FILES[‘haq_slider’] field
- How to trigger $_GET request within admin plugin page?
- Plugin Paths Issue
- How to generate video out of images via WordPress plugin
- WordPress plugin – Error “Plugin generate 2890 characters of unexpected output when activated”
- Woocommerce plugin for minimum order and add-to-card-step
- UnInstallation of a Plugin from a developers perspective – The correct and clean method
- Using a post-signup hook to get user details
- How to apply a patch via plugin?
- wp_remote_get() returns 403 while file_get_contents() does not
- How to set add question capability for author role in wp pro quiz plugin
- Unable to delete custom post types, confusion around capabilities
- Getting wp.me shortlink for wordpress custom post type
- where is the main file in this plugin?
- Remove .htaccess portion upon plugin deactivation?
- breadcrumb need to show all pages and subpages
- Widget’s container?
- custom uploader in the admin area
- Best/Correct way to add an option to a category
- I receive taxonomy id
- Loop in elementor custom widget not working
- Error with get_price (and others) in self-written plugin to show price
- How to access OOP plugin function inside themes or other plugin
- WordPress Widget Not Saving Instance
- Issue with wp_handle_upload
- Different registration form for different roles
- My plugin does not install correctly if a previous version is still installed
- How do I remove all traces of a plugin?
- 404 errors when updating options in admin dashboard
- Is it possible/advisable to set last stable version to previous version?
- How to solve conflict with scripts?
- wp_insert_post not inserting post from XML
- How can replace this url
- Access “wp site health info” data from plugin
- WordPress Frontend Page using Plugin
- How to overwrite a plugin?
- How can I translate something in my class constructor of my plugin in WordPress?
- SimpleXML is not working with xml response from external api
- Change Woo Custom Endpoint Titles from a Plugin
- Custom wp_list_tables redirect on specfic page
- Hook to display element as product on category page
- Missing files in enqueue actions causes WordPress to reload
- I can’t use WP_Query
- Adding/ Removing actions for plugins
- Get input form data posted by users
- WP Plugin: Print javascript in header
- Custom Plugin: Point to `template_directory`
- Adding list of Indexes in wordpress document
- Plugin options not appearing on options page using tabbed navigation
- Storing values in Post Meta vs new tables
- Add custom fields in the new and edit the site forms without touching the WP core
- Extend WordPress REST API with Scheme Pro Plugin
- How to submit the custom form data in database in WordPress without plugin?
- My WP site and password was hacked, what to do? [closed]
- map urls to plugins
- Embed php code in custom field of a plugin [closed]
- Why haven’t I see plugins using get_file_data to handle retrieving plugin version?
- How to add custom html to the Media > Attachment Details modal?
- manage_{taxonomy}_custom_column not working
- Suitable hook when creating, updating and deleting posts programmatically
- How to be Variables and options must be escaped when echo’d?
- How to override plugin function in code snippets WordPress
- How can I gather forums posted by visitors from different sites in one place? [duplicate]