1. Which programming language is the backbone of WordPress development?
(A) Python
(B) PHP
(C) Java
(D) C++
2. Which WordPress file is responsible for initializing the theme?
(A) style.css
(B) functions.php
(C) index.php
(D) wp-config.php
3. Which hook runs after WordPress has loaded but before any headers are sent?
(A) init
(B) wp_loaded
(C) template_redirect
(D) admin_init
4. What is the default database used in WordPress?
(A) PostgreSQL
(B) MongoDB
(C) MySQL/MariaDB
(D) SQLite
5. Which WordPress function is used to safely query the database?
get_results()” onclick=”checkAnswer(‘q5’, ‘$wpdb->get_results()’)” /> (A) $wpdb->get_results()
get_results()’)” /> (B) mysql_query()
get_results()’)” /> (C) wp_query()
get_results()’)” /> (D) run_query()
6. What are custom post types in WordPress?
(A) Additional content types beyond posts and pages
(B) Image formats
(C) SEO plugins
(D) Database backups
7. Which function is used to register a custom post type?
(A) add_post_type()
(B) register_post_type()
(C) create_post_type()
(D) new_post_type()
8. What is the purpose of WP REST API?
(A) Provides an interface for external apps to interact with WordPress data
(B) Optimizes images
(C) Manages plugins
(D) Creates backups
9. Which WordPress file contains the database connection settings?
(A) wp-settings.php
(B) wp-config.php
(C) functions.php
(D) index.php
10. What is a WordPress hook?
(A) A way to modify or extend WordPress functionality without changing core code
(B) A CSS function
(C) An image optimization tool
(D) A theme template
11. Which types of hooks exist in WordPress?
(A) Actions and Filters
(B) Posts and Pages
(C) Widgets and Menus
(D) Themes and Plugins
12. Which function is used to enqueue scripts in WordPress?
(A) load_script()
(B) add_script()
(C) wp_enqueue_script()
(D) register_script()
13. Which WordPress function is used to include template files?
(A) get_template_part()
(B) require_once()
(C) include()
(D) wp_include()
14. How do you register a new WordPress widget area?
(A) add_sidebar()
(B) register_sidebar()
(C) create_widget_area()
(D) wp_add_widget()
15. Which class is used for custom queries in WordPress?
(A) WP_Query
(B) Query_Builder
(C) DB_Query
(D) Post_Query
16. Which WordPress table stores post content?
(A) wp_users
(B) wp_posts
(C) wp_options
(D) wp_postmeta
17. Where are WordPress plugins stored?
(A) /wp-content/plugins/
(B) /wp-admin/plugins/
(C) /wp-includes/plugins/
(D) /plugins/
18. Which WordPress function is used to create custom taxonomies?
(A) add_taxonomy()
(B) register_taxonomy()
(C) new_taxonomy()
(D) wp_taxonomy()
19. What does the function add_action() do?
(A) Hooks a function to a specific action in WordPress
(B) Creates a new page
(C) Adds a new post
(D) Registers a taxonomy
20. Which constant defines WordPress debugging mode?
(A) WP_DEBUG
(B) DEBUG_MODE
(C) WP_DEV
(D) DEBUG_ON
21. What is a nonce in WordPress?
(A) A security token used to protect URLs and forms
(B) A plugin
(C) A custom post type
(D) A database backup
22. Which function is used to create a WordPress shortcode?
(A) create_shortcode()
(B) register_shortcode()
(C) add_shortcode()
(D) new_shortcode()
23. The wp_options table in WordPress stores:
(A) Site settings and plugin configurations
(B) Post data
(C) User comments
(D) Media uploads
24. Which PHP design pattern is commonly used in WordPress database access?
(A) Singleton
(B) Factory
(C) Active Record
(D) Observer
25. What does wp_localize_script() function do?
(A) Passes PHP data to JavaScript
(B) Optimizes CSS
(C) Creates backups
(D) Translates posts
26. Which WordPress function retrieves metadata for posts?
(A) get_post_meta()
(B) post_meta()
(C) fetch_meta()
(D) wp_meta()
27. Which function is used to check if a user is logged in?
(A) is_logged()
(B) wp_login_check()
(C) is_user_logged_in()
(D) current_user()
28. What is the purpose of wp_nonce_field()?
(A) Generates a hidden field with a security nonce for forms
(B) Creates custom fields
(C) Optimizes CSS
(D) Enqueues scripts
29. Which WordPress API is used for handling AJAX requests?
(A) REST API
(B) Options API
(C) AJAX API (admin-ajax.php)
(D) Settings API
30. Which function is used to register custom menus in WordPress?
(A) add_menu()
(B) wp_register_menu()
(C) register_nav_menus()
(D) create_menu()
31. Which WordPress table stores user information?
(A) wp_users
(B) wp_posts
(C) wp_usermeta
(D) wp_options
32. What is the difference between get_template_part() and include()?
(A) get_template_part() is WordPress-aware and allows theme overrides
(B) include() is faster
(C) Both are identical
(D) include() only works with plugins
33. Which function is used to fetch the current theme’s directory URL?
(A) get_theme_url()
(B) get_template_directory_uri()
(C) theme_uri()
(D) wp_theme_url()
34. What does wp_die() function do?
(A) Safely terminates WordPress execution and displays a message
(B) Deletes a post
(C) Resets WordPress
(D) Restarts the database
35. Which function adds a submenu page in WordPress admin?
(A) add_admin_page()
(B) add_submenu_page()
(C) register_submenu()
(D) wp_add_page()
36. Which function is used to sanitize user input in WordPress?
(A) sanitize_text_field()
(B) clean_input()
(C) validate_input()
(D) wp_secure()
37. What does wp_schedule_event() do?
(A) Schedules a recurring task using WordPress Cron
(B) Adds a calendar
(C) Registers a post type
(D) Creates a plugin
38. Which WordPress API is used for storing and retrieving simple options?
(A) Options API
(B) Transients API
(C) Metadata API
(D) REST API
39. Which function is used to retrieve WordPress users?
(A) get_users()
(B) fetch_users()
(C) wp_users()
(D) user_list()
40. The WP Transients API is mainly used for:
(A) Storing cached data temporarily in the database
(B) Creating backups
(C) Optimizing CSS
(D) Handling comments
41. Which function is used to add custom fields to WordPress posts?
(A) add_post_meta()
(B) create_meta()
(C) register_meta()
(D) wp_add_field()
42. What is the primary role of wp_head() function in themes?
(A) Inserts scripts, styles, and metadata in the head section
(B) Loads footer
(C) Registers menus
(D) Displays content
43. Which function retrieves the site URL in WordPress?
(A) site_url()
(B) get_bloginfo(‘url’)
(C) home_url()
(D) All of the above
44. Which WordPress function is used to fetch a list of categories?
(A) get_categories()
(B) wp_categories()
(C) fetch_categories()
(D) list_categories()
45. In WordPress, what is multisite?
(A) A feature that allows multiple websites on a single WordPress installation
(B) A backup plugin
(C) A caching tool
(D) A page builder
46. Which function is used to register custom REST API endpoints?
(A) register_rest_route()
(B) add_api_route()
(C) wp_api_register()
(D) create_route()
47. What does esc_html() function do in WordPress?
(A) Escapes HTML characters for safe output
(B) Optimizes HTML files
(C) Removes CSS
(D) Converts text into headings
48. Which WordPress function is used to update post meta data?
(A) update_post_meta()
(B) edit_post_meta()
(C) wp_post_update()
(D) save_meta()
49. What is WP-CLI?
(A) A command-line tool for managing WordPress installations
(B) A theme framework
(C) A caching system
(D) A REST API plugin
50. The main benefit of child themes in WordPress is:
(A) Preserving customizations during theme updates
(B) Improving database speed
(C) Blocking users
(D) Automatic backups
