Upwork WordPress exam Test Question Answers


Here you will get easily UpworkWordPress test answers helps you to pass easily inside WordPress Ensure that you boost your current skills expertise to the clients inside Upwork.


Upwork WordPress exam Test Question Answers
____________ can manage their own profiles, but can do virtually nothing else in the administration area.
  • Contributor
  • Author
  • Editor
  • Subscriber (Ans)
  • Administrator


____________ can publish, edit, and delete posts and pages written by any user. They can upload some kinds of files, and they can write HTML without restrictions. They can manage links and categori…
  • Contributor
  • Author
  • Editor(Ans)
  • Subscriber
  • Administrator

In order to display a widget, the user must _________________.
  • set the “show property” of the desired widget to “true”
  • drag the desired widget to the side bar (Ans)
  • add the desired widget to the post
  • change the source code

In which way MD5 hash does WordPress stores and represents?
  • In Hex string (Ans)
  • In Base64 string
  • in raw data file
  • text file

Is super cache a built-in plugin of WordPress?
  • Yes
  • No (Ans)

Meta tags can be added to WordPress pages by ________________.
  • using plug-ins
  • adding them to the header.php file
  • updating the database
  • a and (Ans)
  • and c

On which of the following databases can WordPress be installed by default?
  • MySQL (Ans)
  • Oracle Database
  • Microsoft SQL Server
  • PostgreSQL

One possible way to collect realtime statistics about traffic on a WordPress site is:
  • using a built-in tool
  • using a plugin (Ans)
  • using a widget
  • Traffic statistics cannot be collected on a WordPress site.

User Level 7 converts to _________?
  • Contributo
  • Autho
  • Edito
  • Subscribe (Ans)
  • Administrato

What are the correct steps in wordpress plugin development:
  • Step 1 – Create your file and let it be known as a plugin Step 2 – Create the objects of your plugin Step 3 – Adding your actions and filters Step 4 – Adding settings/options to your plugin Step 5 – Finishing the code (Ans)
  • Step 1 – Adding settings/options to your plugin Step 2 – Create your file and let it be known as a plugin Step 3 – Create the objects of your plugin Step 4 – Adding your actions and filters Step 5 – Finishing the code
  • Step 1 – Create the objects of your plugin Step 2 – Adding settings/options to your plugin Step 3 – Create your file and let it be known as a plugin Step 4 – Finishing the code
  • Step 1 – Create the objects of your plugin Step 2 – Adding settings/options to your plugin Step 3 – Finishing the code

What are the database privileges that are required for WordPress?
  • insert, delete, update, drop and alter
  • select, insert, delete, update, create, drop and alter (Ans)
  • insert, delete, update, create, drop and alter
  • insert and delete

What is Automated Testing in WordPress?
  • Automated testing is running test cases where manual intervention is not required to run each one. (Ans)
  • It is a plugin which is used to test your custom template or plugin.
  • It is a function available in WordPress to test the custom template/plugin.
  • There is no such thing as Automated Testing in WordPress.

What is the BEST way to get last inserted row ID from WordPress database ?
  • Use the following code snippet $lastid->$wpdb=$last->get_row;
  • The call to mysql_insert_id() inside a transaction should be added: mysql_query(‘BEGIN’); // Whatever code that does the insert here. $id = mysql_insert_id(); mysql_query(‘COMMIT’); // Stuff with $id.
  • The following code snippet should be added $last = $wpdb->get_row(“SHOW TABLE STATUS LIKE ‘table_name'”); $lastid = $last->Auto_increment;
  • Straight after the $wpdb->insert() insert, the following code should be added: $lastid = $wpdb->insert_id; (Ans)

What is the first action you need to take for enabling the WordPress multisite (MS) feature?
  • Enable the WordPress multisite feature on admin panel
  • Enable the Network feature
  • Add this code to wp-config.php file: define( ‘WP_ALLOW_MULTISITE’, true ); (Ans)

What is the first action you need to take for enabling WordPress MU feature?
  • Enable WordPress MU feature on admin panel
  • Enable Network feature
  • Add this code to wp-config.php file: define( ‘WP_ALLOW_MULTISITE’, true ); (Ans)

What is the function of add_filter in WordPress?
  • It registers a filter for a tag.
  • It removes line breaks from the pages list.
  • It is a companion function to apply_filters().
  • All of the above. (Ans)

What is the limitation to the depth of your categories?
  • 10 levels
  • 20 levels
  • no limit levels (Ans)

What is the output of the following code?
  • <ul id=”sortable”>
    <li id=”1″>example 1</li>
    <li id=”2″>example 2</li>
    <li id=”3″>example 3</li>
    <li id=”4″>example 4</li>
    </ul>
  • $(document).ready(function(){
    $(‘#sortable’).sortable({
    update: function(event, ui) {
    var newOrder = $(this).sortable(‘toArray’).toString();
    $.get(‘saveSortable.php’, {order:newOrder});
    }
    });
    });
  • Removes positions from data base based on the user input
    Saves sortable positions to data base based on the user input (Ans)
  • Adding new sortable positions from another data base
    Sorting o

Which conditional tag checks if the dashboard or the administration panel is attempting to be displayed by returning “true’ (if the URL being accessed is in the admin section) or “false” (for a front-end page).
  • my_admin()
  • view_admin()
  • is_admin() (Ans)
  • root_admin()


_____________ can publish, edit, and delete their own posts. They cannot write pages. They can upload some kinds of media files, and they are allowed to use only the limited set of HTML tags.
  • Contributor
  • Author (Ans)
  • Editor
  • Subscribe
  • Administrator

A possible way to allow the display of several authors’ names on one post is to ______
  • update the database
  • change the admin settings
  • change the config files
  • use a plug-in (Ans)

Are categories and tags available for pages? <b>Note:</b> Categories must have distinct slugs. Even if two categories have different parents and would therefore have different permalinks, you can’…
  • Yes
  • No (Ans)

Can the contents of the wp-content folder be moved or renamed without changing any settings?
  • Yes (Ans)
  • No

Conditional tags can be used to _______________________.
  • get all comments from one post
  • get all posts from one category
  • change the content to be displayed (Ans)
  • None of the above: conditional tags are not available in WordPress.

How can a custom content filter be added?
  • By using add_action(‘the_content’,’my_custom_filter’) (Ans)
  • By using add_filter(‘the_content’,’my_custom_filter’)
  • By using wp_filter(‘the_content’,’my_custom_filter’)
  • By using add_action(‘content’,’my_custom_filter’)

How can a post ID be retrieved from the permalink?
  • Its not possible to retrieve the post ID from a permalink due to its structure.
  • It can be retrieved by using a Regular Expression.
  • wp_get_post_id($permalink)
  • url_to_postid($permalink) (Ans)

How can a user be found through its meta data?
  • User can not be retrieved through its meta data
  • get_user_by_metadata($metaid,$metavalue)
  • get_user($args)
  • get_users($args) (Ans)

How can a WordPress template be integrated inside a codeigniter framework using WordPress functions like wp_header,wp_footer,wp_sidebar?
  • Include the file wp-blog-header.php from WordPress installation directory to codeigniters index.php and create template inside codeigniter’s view. (Ans)
  • Include the file wp-settings.php from WordPress installation directory to codeigniters index.php and create template inside codeigniter’s view.
  • Create template inside WordPress theme directory and include the file in codeigniter’s view.php file.
  • It is not possible to integrate wordpress with codeigniter.

How can an <li> tag’s class and ID attributes be removed from menu items and page lists?
  • add_filter(‘nav_menu_css_class’, ‘my_css_attributes_filter’, 100, 1); add_filter(‘nav_menu_item_id’, ‘my_css_attributes_filter’, 100, 1); add_filter(‘page_css_class’, ‘my_css_attributes_filter’, 100, 1); function my_css_attributes_filter($var) { return is_array($var) ? array() : ”; } (Ans)
  • add_filter(‘nav_menu_css_class’, ‘my_css_attributes_filter’, 100, 1); add_filter(‘nav_menu_item_id’, ‘my_css_attributes_filter’, 100, 1); function my_css_attributes_filter($var) { if(is_array($var)){ $varci= array_intersect($var, array(‘current-menu-item’)); $cmeni = array(‘current-menu-item’); $selava = array(‘selectedmenu’); $selavaend = array(); $selavaend = str_replace($cmeni, $selava, $varci); } else{ $selavaend= ”; } return $selavaend; }
  • add_filter (‘wp_nav_menu’,’strip_empty_classes’); function strip_empty_classes($menu) { $menu = preg_replace(‘/ class=([“\’])(?!active).*?\1/’,”,$menu); return $menu; }
  • None of the above

How can the Home link be disable from the WordPress top nav?
  • Using Jquery to hide it
  • By adding this code in functions.php function page_menu_args( $args ) { $args[‘show_home’] = FALSE; return $args; } add_filter(
  • ‘wp_page_menu_args’, ‘page_menu_args’ ); (Ans)
  • wp_nav_menu( array(‘menu’ => ‘news’, ‘show_home’ => false))
  • Can not disable the default Home link from wordpress top nav

How can the upload media panel be included in a WordPress template/plugin?
  • By using function wp_enqueue_script(‘media-upload’) (Ans)
  • By using function wp_add_media( );
  • By using function wp_enqueue_script(‘upload’);
  • By using function wp_add_script(‘media-upload’);

Image size limits can be set _______________.
  • directly in the posts
  • in the wp-imageresize plug-in
  • in the admin settings (Ans)
  • a and


Which function is used to display the name of current page in wordpress?
  • get_the_title() (Ans)
  • content_title()
  • page_name()
  • post_name()

Which of the follow is a WordPress alternatives for Ruby on Rails?
  • Refinery (Ans)
  • Typof
  • symenta
  • Rubyalt

Which of the following actions cannot be hooked in with add_submenu_page() function?
  • admin_submenu (Ans)
  • admin_menu
  • user_admin_menu
  • network_admin_menu

Which of the following actions must be performed to import data from wordpress.com?
  • Enter the full access to wordpress.com into the data import form so that it can automatically connect and directly retrieve content.
  • Import from wordpress.com’s RSS.
  • Login to wordpress.com, then the export data using the export tool, then import an exported xml file to the site. (Ans)


Which of the following is the correct way to add custom excerpts length identifiers in WordPress?
  • By adding excerpt_length filter in function.php (Ans)
  • Can’t declare custom excerpts in wordpress
  • Custom exceprts are already available in wordpress
  • Using the_excerpt(‘long’); or the_excerpt(‘short’)

Which of the following is the correct way to assign a category to a WordPress post?
  • wp_set_post_categories($postId,$categories) (Ans)
  • wp_set_category($catId,$postId)
  • By XML-RPC call to wpc.newPost
  • This is not possible

Which of the following is the correct way to filter the content for a few posts?
  • By using apply_filters(filter,postId) (Ans)
  • This is not possible in wordpress
  • Can create filter for posts in a specific wordpress category
  • Passing arguments into the_content()

Which of the following is the correct way to get WordPress Post ID from the Post title?
  • $page = get_page_title( ‘About’ ); wp_pages( ‘exclude=’ . $page->ID );
  • $page = get_page_by_title( ‘Home’ ); $page_id = $page->ID; (Ans)
  • $page = get_page_by_title( ‘About’ ); wp_pages( ‘exclude=’ . $page->ID );
  • None of the above

Which of the following is the correct way to print the slug property of $firstTag object in this code snippet? $tags = wp_get_post_tags($post->ID); $firstTag = $tags[0];
  • $firstTag[‘slug’];
  • $firstTag->slug (Ans)
  • $firstTag.slug
  • $firstTag[0][‘slug’]

Which of the following is the correct way to redirect the default login and registration page URL to a custom login and registration page URL?
  • add_action(‘init’,’possibly_redirect’); function possibly_redirect(){ global $pagenow; if( ‘wp-login.php’ == $pagenow ) { return(‘Your custom url’); exit(); } }
  • add_action(‘init’,’possibly_redirect’); function possibly_redirect(){ global $pagenow; if( ‘wp-login.php’ == $pagenow ) { wp_redirect(‘Your custom url’); exit(); } } (Ans)
  • add_action(‘init’,’possibly_redirect’); function possibly_redirect(){ global $pagenow; if( ‘wp-login.php’ == $pagenow ) { redirect(‘Your custom url’); exit(); } }
  • add_action(‘init’,’possibly_redirect’); function possibly_redirect(){ global $pagenow; if( ‘wp-login.php’ == $pagenow ) { wp_return(‘Your custom url’); exit(); } }

Which of the following is the correct way to retrieve a featured image from a post?
  • <?php echo get_post_thumb($page->ID, ‘thumbnail’); ?>
  • <?php echo get_featured_image($page->ID, ‘thumbnail’); ?>
  • <?php echo get_the_post_thumbnail($page->ID, ‘thumbnail’); ?> (Ans)
  • <?php echo get_post_thumbnail($page->ID, ‘thumbnail’); ?>

Which of the following methods can be used to make permalinks SEO friendly?
  • Updating the database
  • changing the source code
  • configuring the feature in the config file
  • configuring the feature in the admin settings (Ans)

Which of the following role levels has the highest privilege?
  • Level_0
  • Level_10 (Ans)
  • Depends on your settings
  • Every role level has the same privilege

Which of the following snippets disable depreciated warnings in WordPress like this one ? “Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-se…
  • define(E_DEPRECATED, false);
  • error_reporting(E_ALL ^ E_DEPRECATED); (Ans)
  • define(E_NOTICE, false);
  • error_reporting(WP_DEBUG, true)

Which of the following will call the WordPress media uploader form element?
  • <form enctype=”multipart/form-data” method=”post” action=”<?=bloginfo(“siteurl”);?>/wp-admin/media-upload.php?inline=&upload-page-form=” class=”media-upload-form type-form validate” id=”file-form”> (Ans)
  • <a onclick=”return false;” title=”Upload image” class=”thickbox” id=”add_image” href=”media-upload.php?type=image&TB_iframe=true&width=640&height=105″>Upload Image</a>
  • <a href=”media-upload.php?type=image&TB_iframe=true&width=640&height=105″>Upload Image</a>
  • <form enctype=”multipart/form-data” method=”post” action=”<?=bloginfo(“bloginfo”);?>/wp-admin/media-upload.php?inline=&upload-page-form=” class=”media-upload-form type-form validate” id=”file-form”>

Which of the following will correctly add custom mod rewrite rules to .htaccess from a WordPress plugin?
  • $custom_mod_rewrite = new custom_mod_rewrite; register_activation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); register_deactivation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); add_action(‘generate_rewrite_rules’, array($custom_mod_rewrite, “generate_rewrite_rules”)); class custom_mod_rewrite { function __construct() { $this->wp_rewrite = & $POST[“wp_rewrite”]; }}
  • $custom_mod_rewrite = new custom_mod_rewrite; register_activation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); register_deactivation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); add_action(‘generate_rewrite_rules’, array($custom_mod_rewrite, “generate_rewrite_rules”)); class custom_mod_rewrite { function __construct() { $this->wp_rewrite = & $GLOBALS[“wp_rewrite”]; } } (Ans)
  • $custom_mod_rewrite = new custom_mod_rewrite; register_activation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); register_deactivation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); add_action(‘generate_rewrite_rules’, array($custom_mod_rewrite, “generate_rewrite_rules”)); class custom_mod_rewrite { function __construct() { $this->wp_rewrite = & $GLOBALS[“wp_rewrite”]; } function mod_rewrite_rules($rules) { return preg_replace(‘#^(RewriteRule \^.*/)\?\$plugin_name .*(http://.*) \[QSA,L\]#mi’, ‘$1 $2 [R=301,L]’, $rules); } }
  • $custom_mod_rewrite = new custom_mod_rewrite; register_activation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); register_deactivation_hook( __FILE__, array($custom_mod_rewrite, ‘flush_rewrite_rules’)); add_action(‘generate_rewrite_rules’, array($custom_mod_rewrite, “generate_rewrite_rules”)); class custom_mod_rewrite { function __construct() { $this->wp_rewrite = & $SESSION[“wp_rewrite”]; } }

Which of the following will correctly load localized (translated) text for a WordPress plugin?
  • function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); load_theme_textdomain(‘tutsplus’, $lang_dir); } add_action(‘after_setup_theme’, ‘custom_theme_setup’);
  • function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); add_action(‘after_setup_theme’, ‘custom_theme_setup’); }
  • function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); add_action(‘after_setup_theme’, ‘custom_theme_setup’); } load_theme_textdomain(‘tutsplus’, $lang_dir); (Ans)
  • function load_theme_textdomain(‘tutsplus’, $lang_dir); { $lang_dir = get_template_directory() . ‘/lang’); custom_theme_setup(); } add_action(‘after_setup_theme’, ‘custom_theme_setup’);

Which of the following will echo the base URL of a WordPress site?
  • <?php echo get_bloginfo(‘base_url’) ?>
  • <?php echo get_bloginfo(‘url’) ?> (Ans)
  • <?php echo get_bloginfo(‘site_url’) ?>
  • <?php echo get_website_url() ?>

Which of the following will give the option to add inline Ajax for comment posting?
  • Enabling Ajax in the wp-config.php file
  • Activating Ajax from the admin settings of WordPress
  • Using the Ajax Comment Posting plugin (Ans)
  • WordPress doesn’t support inline Ajax.

Which of the following will hash a string/password to its md5 equivalent?
  • md5()
  • wp_generate_password() (Ans)
  • wp_generate_md5()
  • password_md5()

Which of the following will show the most recent post (by date) from a custom taxonomy?
  • select * from wp_posts where ID in( select ID from ( select wp_posts.ID , wp_posts.post_date, d.name from wp_posts as a join wp_term_relationships as b on ( a.ID = b.object_id) join wp_term_taxonomy as c on (b.term_taxonomy_id = c.term_taxonomy_id) join wp_terms as d on (c.term_id = d.term_id) where c.taxonomy = ‘post-series’ group by d.name having (wp_posts.post_date = max(wp_posts.post_date)) )tmp)
  • select * from wp_posts where ID in( select ID from ( select wp_posts.ID , wp_posts.post_date, d.name from wp_posts as a join wp_terms as d on (c.term_id = d.term_id) where c.taxonomy = ‘post-series’ group by d.name having (wp_posts.post_date = max(wp_posts.post_date)) )tmp)
  • select * from wp_posts where ID in( select ID from ( select wp_posts.ID , wp_posts.post_date, d.name from wp_posts as a join wp_term_relationships as b on ( a.ID = b.object_id) join wp_term_taxonomy as c on (b.term_taxonomy_id = c.term_taxonomy_id) join wp_terms as d on (c.term_id = d.term_id) having (wp_posts.post_date = max(wp_posts.post_date)) )tmp)
  • select * from wp_posts where ID in( select ID from ( select wp_posts.ID , wp_posts.post_date, d.name from wp_posts as a join wp_term_relationships as b on ( a.ID = b.object_id) join wp_terms as d on (c.term_id = d.term_id) where c.taxonomy = ‘post-series’ group by d.name having (wp_posts.post_date = max(wp_posts.post_date)) )tmp) (Ans)

Which of the following WordPress Multisite functions allows for getting content from one blog and display it on another?
  • switch_blog()
  • switch_to_blog() (Ans)
  • restore_current_blog()
  • restore_to_current_blog()

Which of the functions below is required to create a new taxonomy?
  • add_taxonomy
  • register_taxnoomy (Ans)
  • create_taxonomy

Which PHP method(s) can be used to send form data that is persistent across succeeding page views (such as for a language selection feature) in WordPress?
  • POST
  • GET
  • SESSION or COOKIE (Ans)
  • POST oe GET

WordPress’s requirements are modest. At minimum, which of the following standards should your server support for WordPress 3.1?
  • PHP version 4.4.9 or greater, MySQL version 4.0 or greater
  • PHP version 4.3 or greater, MySQL version 4.1.2 or greater (Ans)
  • PHP version 4.4.9 or greater, MySQL version 5.1 or greater
  • PHP version 4.3 or greater, MySQL version 5.1 or greater

You can limit the number of revisions WordPress stores by _____ <b>Note:</b> Categories must have distinct slugs. Even if two categories have different parents and would therefore have different p…
  • adding the following line to your wp-config.php file: define(‘WP_POST_REVISIONS’, 3); (Ans)
  • using a plugin
  • changing a setting on admin panel

Which of the following code snippets best protects a system from SQL injections?
  • sql_real_escape_strong()
  • mysql_real_escape()
  • mysql_real_escape_string() (Ans)
  • mysql_not_real_delete_string()

Which of the following code snippets can be used to create custom POST status in wordpress 3.0 +?
  • register_new_post()
  • register_post_status() (Ans)
  • add_new_post_status()
  • modify_post_status()

Which of the following code snippets is the correct way to get content from Tinymce via javascript ?
  • document.getElementById(‘content’)
  • tinymce.activeEditor.getContent(); (Ans)
  • tinymce.element.getContent();
  • document.getElement(‘tinymce_content’)

Which of the following code snippets will create plugins back-end page without showing it as menu item?
  • add_submenu_page with parent slug = null (Ans)
  • add_menu_page with parent slug = null
  • add_submenu_page without parent slug = null
  • add_menu_page without parent slug = null

Which of the following codes will return the current plugin directory in WordPress?
  • <?php plugin_basename($file); ?> (Ans)
  • <?php plugin_basename(‘url’); ?>
  • <?php bloginfo_plugin(‘url’); ?>
  • <?php content_plugin_url( $path ); ?>

Which of the following commands can change the ownership of WordPress directory to www-data (for Apache)?
  • sudo chown -Rf www-data * (Ans)
  • chown -Rf www-data *
  • sudo crown -Df www-data *
  • Alldo chown -Rf www-data *

Which of the following functions are used to add administration menu item in WordPress ?
  • add_menu_page(); (Ans)
  • add_admin_item();
  • add_admin_page();
  • add_admin_option();

Which of the following functions are used when adding CSS and jQuery codes on a WordPress plugin?
  • wp_register_style
  • wp_enqueue_style (Ans)
  • wp_enqueue_script
  • None of these.

Which of the following functions can be used to create a WordPress page?
  • wp_insert_post() (Ans)
  • wp_insert_page()
  • wp_create_post()
  • wp_create_page()

Which of the following is an example of a WordPress plugin that provides multilingual capabilities?
  • WP Supper cache
  • qTranslate (Ans)
  • BuddyPress
  • Hotfix

Which of the following is the correct code to get an array of every image uploaded to a particular post?
  • $images =& get_children( ‘post_type=attachment&post_mime_type=image&post_parent=10’ );
  • $images = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); (Ans)
  • $images = get_post(7, ARRAY_A);
  • It cannot be done

Which of the following is the correct sequence of steps to adapt a WordPress plugin to a multisite?
  • 1. Use $wpdb to iterate through all blogs 2. Hook according to the $blog_id 3. Install the plugin as Network only 4. Uninstall depends the specific plugin (Ans)
  • 1. Use $wp_posts to iterate through all blogs 2. Hook according to the $function 3. IInstall the plugin as Network only 4. Uninstall depends the specific plugin
  • 1. Use $wp_posts to iterate through all blogs 2. Hook according to the $function 3. Install other activations except Network 4. Uninstall is the same for all the plugins
  • 1. Use $wp_posts to iterate through all blogs 2. Hook according to the $function 3. Install the plugin as Network only 4. Uninstall is same for all the plugins
Thanks for following this Upwork wordpress test Question and Answer

0 comments: