What problems maybe happen if I remove “wp-” prefix from wordpress folders and files?

I want to hide wordpress signs from my site. So I don’t want other people know that I built the website via WordPress. So I decided to remove wp- prefixes from all wordpress folders and files. And I also removed wp- prefixes from file contents with Notepad++. So my question is what problems maybe happen … Read more

How can I add my script to admin using script-loader.php?

I’m trying to load my custom script in the admin panel using the same method that WordPress itself loads scripts in the admin area. This is an example script being loaded by wp-includes/script-loader.php: $scripts->add( ‘password-strength-meter’, “/wp-admin/js/password-strength-meter$suffix.js”, array( ‘jquery’, ‘zxcvbn-async’ ), false, 1 ); So I tried to add my own script by the same method. … Read more

Two domains on one WordPress Installation

I recently changed the base domain on my WordPress website from http://www.fsdegrees.com to http://www.56degrees.co.uk. I would like to create various of 301 from old domain to new one, but for some reason I can still access pages using the old domain www.fsdegrees.com/blog I though it should come back with 404. I’m just afraid that Google … Read more

Changing a WordPress core function without hacking core

I am looking to change one line within a core function. The function is wp_allow_comment() located within /wp-includes/comment.php function wp_allow_comment($commentdata) { global $wpdb; extract($commentdata, EXTR_SKIP); // Simple duplicate check // expected_slashed ($comment_post_ID, $comment_author, $comment_author_email, $comment_content) $dupe = $wpdb->prepare( “SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_parent = %s AND comment_approved != ‘trash’ AND … Read more

Headers already sent – WordPress core

I’m getting an error on my site regarding “headers already sent”: Warning: Cannot modify header information – headers already sent by (output started at ………/wp-admin/menu-header.php:161) in ……/wp-includes/pluggable.php on line 881 I read the WordPress FAQ that discusses this, but – as you can see – this error is caused by the WordPress core (and not … Read more

How to edit or override a Core function?

I want to add a data argument to links generated by the paginate_links() function. Then, I can more easily extend my custom pagination to use AJAX. As far as I can tell, this function is not pluggable, nor does it have any hooks available. The links generated by paginate_links() look like this: <a class=”page-numbers” href=”https://example.com/list/page/2/”><span … Read more

How to remove X-Frame-Options: SAMEORIGIN” from WordPress?

I want to temporarily remove X-Frame-Options: SAMEORIGIN and need to allow all domains. I have already tried the following ways. Removing send_frame_options_header from ./wp-includes/default-filters.php remove_action(‘login_init’, ‘send_frame_options_header’); Removing @header( ‘X-Frame-Options: SAMEORIGIN’ ); from /wp-includes/functions.php None of the above doesn’t work. PS: I don’t use any security plugin either. 1 Answer 1 Check this question How does … Read more

Why are double-periods (“..”) invalid in a WordPress image filename?

ms-files.php contains the following code fragment: $file = rtrim( BLOGUPLOADDIR, “https://wordpress.stackexchange.com/” ) . “https://wordpress.stackexchange.com/” . str_replace( ‘..’, ”, $_GET[ ‘file’ ] ); if ( !is_file( $file ) ) { status_header( 404 ); die( ‘404 &#8212; File not found.’ ); } This code determines whether or not the file can be found. However, it does something … Read more

Modifying the media-template.php file, the right way?

The shortcode accepts the columns=”0″ as an attribute so that it doesn’t insert any breaks in the HTML between gallery items, however this option is not available in Gallery Settings interface (“Add Media” pop-up when editing pages/posts). I’ve located the code in wp-includes\media-template.php line 396 to 406; <label class=”setting”> <span><?php _e(‘Columns’); ?></span> <select class=”columns” name=”columns” … Read more

How can I modify what is being output in wp_head, whether by a theme or WordPress in general?

I’ve been working on performance of my site using YSLOW, and noticed that WordPress it outputting things in my document head that I know I don’t need. For example, I’m already calling jQuery 1.9 from the Google CDN, so I don’t need the call to jQuery in wp-includes. Also, a plugin is including a stylesheet … Read more