Maharshi Kushwaha
Forum Replies Created
-
Forum: Everything else WordPress
In reply to: Rank Math Pro Sometimes Hangs My WebsiteI think you should ask the Rank Math support team for help because they might know how to fix this. If it still doesn’t work, you can try using another SEO plugin like Yoast SEO or All in One SEO.
Forum: Developing with WordPress
In reply to: How to prevent the same user submit the same form twice?Use WPForms’ “Limit Entries” Addon
- Install the “Form Locker” Addon:
- Go to your WordPress dashboard.
- Navigate to WPForms > Addons.
- Search for the Form Locker Addon and install/activate it.
- Set Entry Limits:
- Open your form in the WPForms editor.
- Go to Settings > Form Locker.
- Enable the Limit Form Entries option.
- Choose “Limit by User” and configure additional settings if needed, such as custom error messages.
- Save the form, and users will now be prevented from submitting the form more than once.
Forum: Everything else WordPress
In reply to: How to prevent RSS feeds from displaying images from postsOption 1: Use Custom Code
Add the following code to your theme’s
functions.php
file:function remove_images_from_rss($content) {
$content = preg_replace('/<img[^>]*>/i', '', $content); // Removes <img> tags
return $content;
}
add_filter('the_content_feed', 'remove_images_from_rss');
add_filter('the_excerpt_rss', 'remove_images_from_rss');After saving, check your RSS feed (
yourwebsite.com/feed/
) to ensure images no longer appear.Option 2: Use a Plugin
If you’re not comfortable editing code, use a plugin like Disable Feeds or RSS Customizer. These plugins allow you to customize or disable RSS feed elements, including images, without writing code.
Forum: Fixing WordPress
In reply to: More Details not loadingHi @redpanda86a,
This error usually happens because of X-Frame-Options or similar security settings that prevent a site from being embedded in an iframe. Here’s how to troubleshoot and fix it:
- Check for Plugin Conflicts:
- Disable all plugins again and check if the issue persists.
- If it’s fixed, reactivate plugins one by one to find the one causing the problem.
- Inspect Your Theme:
- Some themes have built-in security settings or iframe restrictions. Switch to a default theme (like Twenty Twenty-Three) and test again.
- Browser Security Settings:
- If your site’s headers restrict embedding, your browser will block it. Contact your hosting provider or check your
.htaccess
file (if using Apache) for rules likeX-Frame-Options: DENY
and modify it if necessary.
- If your site’s headers restrict embedding, your browser will block it. Contact your hosting provider or check your
- Workaround for the Issue:
- Since the page won’t load in an iframe, try opening it directly in a new tab (right-click and “Open Link in New Tab”).
If you still need help, share more details, like the exact URL and any specific plugins or themes you’re using.
Forum: Fixing WordPress
In reply to: My site is scrambled. Reset instructions don’t work.Hi @willownew,
It sounds like you’re using a self-hosted WordPress site, which is why you don’t see the “Hosting” tab. To reset your site, try using a plugin like WP Reset:
- Go to Plugins > Add New, search for WP Reset, install, and activate it.
- Follow its instructions to reset your site (this will wipe everything).
If you prefer manual reset, log in to your hosting account (like cPanel) and either reinstall WordPress or delete your current database and create a new one.
As for your “scrambled” site:
- Make sure the Craftily theme is active under Appearance > Themes.
- Use Appearance > Menus to clean up your menu.
- Add new pages via Pages > Add New.
For the front page, it might be a cache issue. Clear your browser cache or use a plugin like WP Super Cache to clear your site’s cache.
Let me know if you need more help!
Forum: Everything else WordPress
In reply to: Page with redirect in Google Indexing attemptIt seems like the issue might stem from a mismatch between the URLs you’re submitting to Google Search Console (GSC) and how your site is actually being served. For example, if your site is opening with HTTPS but you’re submitting the HTTP version in GSC, Google might flag it as a “Page with redirect” because HTTP is redirecting to HTTPS.
To resolve this:
- Check Your URL: Ensure you’re submitting the correct version of your site (e.g.,
https://yourwebsite.com
) in Google Search Console. GSC should always match the protocol (HTTP or HTTPS) that your site uses. - Inspect the Affected Pages: Since GSC provided a list of URLs with redirects, use the “Inspect URL” tool in GSC for more details. This will help identify where the redirects are pointing and the type of redirect (301, 302, etc.).
- Verify WordPress Settings: Go to Settings > General in your WordPress dashboard and confirm that both the “WordPress Address (URL)” and “Site Address (URL)” fields are set to HTTPS.
- Check for Redirect Rules: Review your
.htaccess
file (if using Apache), NGINX configuration, or any redirect rules set by plugins like Yoast SEO or Redirection. Ensure that your redirects are configured correctly to point to the preferred HTTPS version.
If you’re still unclear about the root cause, feel free to share a screenshot of the exact error in GSC for a deeper analysis. This will help pinpoint whether the issue is related to WordPress, your server, or something else entirely.
Hope this helps! Let me know if you need further assistance. ??
Here is the corrected code to dynamically pass server-side HTML based on the selected value in Contact Form 7 (CF7) and ensure the content, including the button, displays properly in
mail_2
:add_filter('wpcf7_additional_mail', 'customize_mail_2', 10, 2);
function customize_mail_2($additional_mail, $contact_form) {
$submission = WPCF7_Submission::get_instance();
if ($submission) {
$data = $submission->get_posted_data();
// Fetch and sanitize the selected value
$selected_solution = isset($data['solutionreq']) ? sanitize_text_field($data['solutionreq']) : '';
// Create the HTML button based on the selected value
$buttonHtml = '';
if ($selected_solution === 'Accounting solution') {
$buttonHtml = '<a target="_blank" style="display:inline-block;padding:10px 20px;color:#fff;background-color:#0073aa;text-decoration:none;border-radius:5px;">Download Accounting Solution</a>';
} elseif ($selected_solution === 'Billing solution') {
$buttonHtml = '<a target="_blank" style="display:inline-block;padding:10px 20px;color:#fff;background-color:#0073aa;text-decoration:none;border-radius:5px;">Download Billing Solution</a>';
} else {
$buttonHtml = '<p>No solution selected or invalid value.</p>';
}
// Set the body of mail_2
$additional_mail['mail_2']['body'] = '<p><strong>Selected Solution:</strong> ' . esc_html($selected_solution) . '</p>
<div>' . $buttonHtml . '</div>';
} else {
error_log('Submission instance is null.');
}
return $additional_mail;
}Forum: Fixing WordPress
In reply to: Fake-administrator priviligesTo regain Administrator privileges and fix the site:
- Check Database User Role: Use phpMyAdmin to confirm your user has
administrator
privileges in thewp_usermeta
table. Updatewp_capabilities
toa:1:{s:13:"administrator";b:1;}
if needed. - Verify File Permissions: Ensure files have
644
and folders755
permissions via FTP or File Manager. - Disable Plugins/Themes: Rename
wp-content/plugins
andwp-content/themes
folders via FTP to disable them temporarily. - Force Admin Role via Code: Add this snippet to your theme’s
functions.php
file:
function grant_admin_access() { $user = get_user_by('login', 'your_admin_username'); if ($user) $user->set_role('administrator'); } add_action('init', 'grant_admin_access');
Replaceyour_admin_username
with your username, reload the site, and then remove the code.Scan for Malware: Use plugins like Wordfence or Sucuri to remove malicious code.
Reinstall WordPress Core: Replace all files (except wp-config.php and wp-content) with a fresh WordPress download.
Forum: Developing with WordPress
In reply to: Where can I change default wordpress error login messages?To customize the default login error messages in WordPress, use the following code in your child theme’s
functions.php
file:function my_custom_login_error_message( $error ) {
// Check if it's an invalid username error
if ( strpos( $error, 'Invalid username' ) !== false ) {
$error = '<strong>ERROR</strong>: The username you entered is not registered. Please check and try again.';
}
// Check if it's an incorrect password error
if ( strpos( $error, 'incorrect' ) !== false ) {
$error = '<strong>ERROR</strong>: The password you entered is incorrect. Please try again.';
}
return $error;
}
add_filter( 'login_errors', 'my_custom_login_error_message' );Steps to Implement:
- Add the code above to your child theme’s
functions.php
file. - Clear your website and browser cache to ensure changes are reflected.
- Test the login page:
- Enter an invalid username to see the custom message: “The username you entered is not registered.”
- Enter an incorrect password to see the custom message: “The password you entered is incorrect.”
This method uses the
login_errors
filter to replace the default WordPress login error messages with custom ones.If the changes are not visible, ensure there are no caching issues or plugin conflicts, and verify that the code is placed correctly in your active theme.
If strange posts are still appearing on your site despite scanning with Sucuri and Wordfence, the hacker may have inserted malicious code into your database or core files. Here’s what to do:
- Inspect the Database: Check your WordPress database for any suspicious entries, especially in the
wp_posts
orwp_options
table. - Reinstall Core Files: Replace your WordPress core files by downloading a fresh copy from www.remarpro.com and uploading it via FTP, except for the
wp-config.php
file andwp-content
folder. - Check Theme and Plugin Files: Manually review your theme and plugin files for unfamiliar or obfuscated code.
- File Permissions: Ensure your file permissions are secure (644 for files, 755 for folders).
- Restrict Access: Change all passwords (WordPress, hosting, FTP) and consider enabling two-factor authentication.
- Monitor Logs: Check server logs to identify suspicious activity or repeated access patterns.
- Harden Security: Use a WordPress hardening guide to lock down your website further.
If the issue persists, consider consulting a professional WordPress security expert to clean the site thoroughly.
Forum: Installing WordPress
In reply to: Verify your site ownershipYou can verify site ownership without using a plugin by following these steps:
- Log in to your WordPress admin dashboard.
- Navigate to Appearance > Theme File Editor.
- On the right-hand side, locate and click on the
header.php
file under your active theme. - Add the meta verification code provided by Google just before the
</head>
tag in the code. - Click Update File to save your changes.
- Go back to Google Search Console and click Verify to confirm the ownership.
Be cautious when editing theme files to avoid breaking your site. If you’re using a child theme or a custom header file, make sure to edit the correct file for the changes to take effect.
- Install the “Form Locker” Addon: