Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

How do I create a function that modifies a message in the wp-login.php file?

If there is no filter to change the content, the other option is to add a function hooked to gettext – for example:

/**
 * Change text strings
 *
 * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
 */
function wpse_382257_text_strings( $translated_text, $text, $domain ) {
    switch ( $translated_text ) {
        case 'Check your email for the confirmation link, then visit the login page.' :
            $translated_text = __( 'SOMETHING ELSE', 'text-domain' );
            break;
        
        case 'Another' :
            $translated_text = __( 'Whatever..', 'text-domain' );
            break;
    }
    return $translated_text;
}
add_filter( 'gettext', 'wpse_382257', 20, 3 );

ref: https://developer.wordpress.org/reference/hooks/gettext/

Related Posts:

  1. Enforcing password complexity
  2. How to redirect users to custom lostpassword page?
  3. WordPress if (is_page) translation on certain page
  4. How to implement __() function in my theme’s php file?
  5. Hook into all password resets in WordPress and get password before hashing?
  6. Issue encountered while trying to keep website private
  7. Password form redirection to belonging post
  8. ACF: how do I get the fields and its values of a specific group?
  9. How to store data from multiple forms using ajax and php
  10. How to control WordPress image metadata (using Imagick)?
  11. How to add seperate classes to no-search-result and found-search-result pages on wordrpess search – is_search()
  12. Get value from shortcode to do something
  13. PHP 8, AJAX mail form to function.php doesn’t work
  14. How do I add custom bulk actions to multiple custom post types?
  15. Error when adding excerpt to the content through functions.php
  16. Automatically adding new post categories to menu
  17. Add data attribute to each li in menu
  18. Get post id in a function when edit/add a post
  19. Making BuddyPress Activity Stream (Post Type) Featured Images Clickable [closed]
  20. How to check if a meta value has already been assigned to any user?
  21. How to complete two other input fields, completed the first
  22. Prev/Next child navigation for current page modifications?
  23. Adding rel tag to all external links
  24. How can I apply_filters from inside a function?
  25. function to assign user role based on a field from usermeta
  26. How to limit the number of forgot password reset attempts in WordPress?
  27. what is the best practice to add new field to an api route
  28. Retrieve $_POST data submitted from external URL in WordPress(NOT API)
  29. Pass Category Name, Description and Photo into variables to pass to jQuery
  30. Use DOMDocument with ob_start breaks my HTML code
  31. Auto-update products after they were published – Woocommerce
  32. How to prevent WP_Query function from returning all posts when empty?
  33. wp_trim_words() does not work with my code Am I doing any mistake in my code?
  34. JS file work only in index page
  35. Display a specific category of products in shop page and disable code for specific actions
  36. Woocommerce related product text
  37. esc_html_e() is not translating string in wordpress [closed]
  38. Removing “wpautop” (auto tags) only on certain pages?
  39. Fatal error: Uncaught Error: Call to undefined function test()
  40. How to pick the default selected value in wordpress dropdown?
  41. Using WP-API and SSE not authenticating user ID
  42. Woocommerce: hook action/filter I could use to add variation id and price with each attribute opt on WooCommerce Rest api
  43. Validate functions before inserting then into functions.php
  44. How to retrieve current wordpress profile page URL?
  45. Firing schema via code in functions.php doesn’t work
  46. A non-numeric value encountered in /wp-includes/functions.php on line 68
  47. Get page that displays all children of taxonomy parent
  48. Ajax request not sending to server and returning – wp-admin/admin-ajax.php 400
  49. get author_name from queried post
  50. Why ajax doesn’t work on certain wordpress hooks?
  51. Is it possible to intercept all ajax requests and get the parameters and the returns?
  52. How to call plugin function per site in a multisite?
  53. Print last modified date only on posts
  54. different id for same element visual composer [closed]
  55. WooCommerce: How can I get orders with a custom ID in order meta data object?
  56. Tax query in pre_get_posts not working
  57. WordPress Gravatar filter is removing my custom attributes
  58. foreach loop still echoes array
  59. trigger html cleanup for all posts
  60. Error in custom php function doesn’t exist
  61. dynamic dependent select dropdown
  62. Generating an nonce for Content Security Policy and all scripts – How to make it match/persist for each page load?
  63. Custom shortcode outputs plain text instead of HTML at top of post
  64. how can i use $_COOKIE[] + PostID to execute the below code?
  65. Return a numerical function value in Customizer controls
  66. getting logged in user info (wp-load.php) from parent directory
  67. How can I get the values of my WordPress $wpdb query in Jquery?
  68. What’s the uses of wp_cache_set() or wp_cache_add()?
  69. Get users that likes the post
  70. Blog posts repeat
  71. Ajax load more button for comments wordpress
  72. Function to capture a value and store it in a variable
  73. How to abort saving data in save_extra_profile_fields function WordPress?
  74. Pass php dynamic variable to shortcode
  75. Unique icons next to each WordPress menu item
  76. 3 Slashes appear after Apostrophe in custom fields after updating product-site
  77. How to create a php variable using WordPress the_title() function
  78. Keyword checking in Gravity Forms
  79. how to refresh div on template part?
  80. Child page menu in sidebar
  81. Populate editor with some content of a page with a page template
  82. Title Case WordPress Menu Items
  83. I want to load in a new class but only if the current page is single-movies.php
  84. Modify function to print tags/categories/exclude tags/categories/ number of posts
  85. Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
  86. Search not showing all results
  87. Validation algorithm in checkout field
  88. Css loads very slow [closed]
  89. Catchable fatal error: Object of class stdClass could not be converted to string after WP 4.7
  90. Show when user is online/offline in real time on user_profile.php
  91. Limit 1 global comment per minute
  92. Create highly customized submenu (possibly using wp_list_pages)
  93. Create Page To Count Comments For Each Post In WordPress Site
  94. Modify custom field input data before creating a new post
  95. Adding a widget function into the php theme file
  96. Update user profile information from functions.php
  97. WordPress Quick Question . How to Get Parent Link in Submenu in My Code
  98. Get the date of the className or classID
  99. My new button is in the wrong place
  100. Can’t find infinite loop cause
Categories PHP Tags functions, password, php, translation, wp-login-form
How to get custom taxonomy terms based on another taxonomy?
One account with multiple logins

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress