-
Notifications
You must be signed in to change notification settings - Fork 0
/
noindex-seo.php
844 lines (789 loc) · 31.3 KB
/
noindex-seo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
<?php
/**
* Plugin Name: noindex SEO
* Plugin URI: https://wordpress.org/plugins/noindex-seo/
* Description: Allows to add a meta-tag for robots noindex in some parts of your WordPress site.
* Requires at least: 5.2
* Requires PHP: 5.6
* Version: 1.0.12
* Author: Javier Casares
* Author URI: https://www.javiercasares.com/
* License: EUPL v1.2
* License URI: https://eupl.eu/1.2/en/
* Text Domain: noindex-seo
* Domain Path: /languages
*
* @package noindex-seo
*/
defined( 'ABSPATH' ) || die( 'Bye bye!' );
/**
* Retrieves and sets the SEO 'noindex' values for various WordPress contexts.
* @global WP_Post $post The post global for the current post, if within The Loop.
*
* @return void
*
* @since 1.0.0
*
* @uses get_option() Fetches an option value based on an option name.
*/
function noindex_seo_show() {
global $post;
$enter = true;
$noindex_seo_values = array(
'error' => (bool) get_option( 'noindex_seo_error' ),
'archive' => (bool) get_option( 'noindex_seo_archive' ),
'attachment' => (bool) get_option( 'noindex_seo_attachment' ),
'author' => (bool) get_option( 'noindex_seo_author' ),
'category' => (bool) get_option( 'noindex_seo_category' ),
'comment_feed' => (bool) get_option( 'noindex_seo_comment_feed' ),
'customize_preview' => (bool) get_option( 'noindex_seo_customize_preview' ),
'date' => (bool) get_option( 'noindex_seo_date' ),
'day' => (bool) get_option( 'noindex_seo_day' ),
'feed' => (bool) get_option( 'noindex_seo_feed' ),
'front_page' => (bool) get_option( 'noindex_seo_front_page' ),
'home' => (bool) get_option( 'noindex_seo_home' ),
'month' => (bool) get_option( 'noindex_seo_month' ),
'page' => (bool) get_option( 'noindex_seo_page' ),
'paged' => (bool) get_option( 'noindex_seo_paged' ),
'post_type_archive' => (bool) get_option( 'noindex_seo_post_type_archive' ),
'preview' => (bool) get_option( 'noindex_seo_preview' ),
'privacy_policy' => (bool) get_option( 'noindex_seo_privacy_policy' ),
'robots' => (bool) get_option( 'noindex_seo_robots' ),
'search' => (bool) get_option( 'noindex_seo_search' ),
'single' => (bool) get_option( 'noindex_seo_single' ),
'singular' => (bool) get_option( 'noindex_seo_singular' ),
'tag' => (bool) get_option( 'noindex_seo_tag' ),
'time' => (bool) get_option( 'noindex_seo_time' ),
'year' => (bool) get_option( 'noindex_seo_year' ),
);
// GLOBAL IMPORTANT PAGES.
if ( $enter && $noindex_seo_values['front_page'] && function_exists( 'is_front_page' ) && is_front_page() ) {
noindex_seo_metarobots();
$enter = false;
}
if ( $enter && $noindex_seo_values['home'] && function_exists( 'is_home' ) && is_home() ) {
noindex_seo_metarobots();
$enter = false;
}
// PAGES / POSTS.
if ( $enter && $noindex_seo_values['page'] && function_exists( 'is_page' ) && is_page() ) {
noindex_seo_metarobots();
$enter = false;
}
if ( $enter && $noindex_seo_values['privacy_policy'] && function_exists( 'is_privacy_policy' ) && is_privacy_policy() ) {
noindex_seo_metarobots();
$enter = false;
}
if ( $enter && $noindex_seo_values['single'] && function_exists( 'is_single' ) && is_single() ) {
noindex_seo_metarobots();
$enter = false;
}
if ( $enter && $noindex_seo_values['singular'] && function_exists( 'is_singular' ) && is_singular() ) {
noindex_seo_metarobots();
$enter = false;
}
// CATEGORIES / TAGS.
if ( $enter && $noindex_seo_values['category'] && function_exists( 'is_category' ) && is_category() ) {
noindex_seo_metarobots();
$enter = false;
}
if ( $enter && $noindex_seo_values['tag'] && function_exists( 'is_tag' ) && is_tag() ) {
noindex_seo_metarobots();
$enter = false;
}
// DATES.
if ( $enter && $noindex_seo_values['date'] && function_exists( 'is_date' ) && is_date() ) {
noindex_seo_metarobots();
$enter = false;
}
if ( $enter && $noindex_seo_values['day'] && function_exists( 'is_day' ) && is_day() ) {
noindex_seo_metarobots();
$enter = false;
}
if ( $enter && $noindex_seo_values['month'] && function_exists( 'is_month' ) && is_month() ) {
noindex_seo_metarobots();
$enter = false;
}
if ( $enter && $noindex_seo_values['time'] && function_exists( 'is_time' ) && is_time() ) {
noindex_seo_metarobots();
$enter = false;
}
if ( $enter && $noindex_seo_values['year'] && function_exists( 'is_year' ) && is_year() ) {
noindex_seo_metarobots();
$enter = false;
}
// ARCHIVE.
if ( $enter && $noindex_seo_values['archive'] && function_exists( 'is_archive' ) && is_archive() ) {
noindex_seo_metarobots();
$enter = false;
}
if ( $enter && $noindex_seo_values['author'] && function_exists( 'is_author' ) && is_author() ) {
noindex_seo_metarobots();
$enter = false;
}
if ( $enter && $noindex_seo_values['post_type_archive'] && function_exists( 'is_post_type_archive' ) && is_post_type_archive() ) {
noindex_seo_metarobots();
$enter = false;
}
// PAGINATION.
if ( $enter && $noindex_seo_values['paged'] && function_exists( 'is_paged' ) && is_paged() ) {
noindex_seo_metarobots();
$enter = false;
}
// SEARCH.
if ( $enter && $noindex_seo_values['search'] && function_exists( 'is_search' ) && is_search() ) {
noindex_seo_metarobots();
$enter = false;
}
// ATTACHMENT.
if ( $enter && $noindex_seo_values['attachment'] && function_exists( 'is_attachment' ) && is_attachment() ) {
noindex_seo_metarobots();
$enter = false;
}
// PREVIEW.
if ( $enter && $noindex_seo_values['customize_preview'] && function_exists( 'is_customize_preview' ) && is_customize_preview() ) {
noindex_seo_metarobots();
$enter = false;
}
if ( $enter && $noindex_seo_values['preview'] && function_exists( 'is_preview' ) && is_preview() ) {
noindex_seo_metarobots();
$enter = false;
}
// ERROR.
if ( $enter && $noindex_seo_values['error'] && function_exists( 'is_404' ) && is_404() ) {
noindex_seo_metarobots();
$enter = false;
}
unset( $enter, $noindex_seo_values );
}
/**
* Outputs a 'noindex' meta robots tag to the page.
*
* This function prints the 'noindex' meta robots tag, instructing search engines
* not to index the content of the current page.
*
* @since 1.0.0
*
* @return void
*
* @uses echo Outputs the meta robots tag to the webpage.
*/
function noindex_seo_metarobots() {
echo '<meta name="robots" content="noindex">' . "\n";
}
add_action( 'wp_head', 'noindex_seo_show' );
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'noindex_seo_settings_link' );
add_action( 'admin_init', 'noindex_seo_register' );
add_action( 'admin_menu', 'noindex_seo_menu' );
/**
* Adds a 'Settings' link to the plugin action links on the plugins page.
*
* This function appends a direct link to the plugin's settings page within the WordPress admin dashboard,
* making it easier for users to access and configure the plugin settings.
*
* @since 1.0.0
*
* @param array $links An array of action links already present for the plugin.
*
* @return array Returns the updated array of action links including the 'Settings' link.
*
* @uses get_admin_url() Fetches the admin URL for the current site with optional path attached.
* @uses __() Retrieves a translated string.
*/
function noindex_seo_settings_link( $links ) {
$links[] = '<a href="' . get_admin_url( null, 'options-general.php?page=noindex_seo' ) . '">' . esc_html( __( 'Settings' ) ) . '</a>';
return $links;
}
/**
* Adds a 'noindex SEO' options page to the WordPress admin menu.
*
* This function creates an options page titled 'noindex SEO' within the WordPress admin dashboard.
* The page provides a UI for configuring settings related to the 'noindex SEO' functionality.
*
* @since 1.0.0
*
* @return void
*
* @uses add_options_page() Adds a new options page to the admin menu.
* @uses __() Retrieves a translated string.
*/
function noindex_seo_menu() {
add_options_page( __( 'noindex SEO', 'noindex-seo' ), __( 'noindex SEO', 'noindex-seo' ), 'manage_options', 'noindex_seo', 'noindex_seo_admin' );
}
/**
* Registers settings for the 'noindex SEO' plugin.
*
* This function registers a variety of settings associated with the 'noindex SEO' functionality in WordPress.
* Each setting determines whether specific pages or post types should be excluded from search engine indexing.
* The settings values are integers, with a default value of 0 (which typically represents 'false' or 'off' in boolean context).
*
* @since 1.0.0
*
* @return void
*
* @uses register_setting() Registers a setting and its data.
*/
function noindex_seo_register() {
register_setting(
'noindexseo',
'noindex_seo_error',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_archive',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_attachment',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_author',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_category',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_comment_feed',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_customize_preview',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_date',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_day',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_feed',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_front_page',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_home',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_month',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_page',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_paged',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_post_type_archive',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_preview',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_privacy_policy',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_robots',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_search',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_single',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_singular',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_tag',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_time',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_year',
array(
'type' => 'integer',
'default' => 0,
)
);
}
/**
* Displays the administration settings page for the 'noindex SEO' plugin.
*
* This function provides the markup for the settings page of the plugin in the WordPress admin area.
* It shows the header for the settings, followed by the form that contains the settings fields.
* Each setting determines if specific pages or post types should be excluded from search engine indexing.
* The options are retrieved from the WordPress database and are displayed on the form.
*
* @since 1.0.0
*
* @return void
*
* @uses settings_fields() Outputs nonce, action, and option_page fields for a settings page in the form.
* @uses get_option() Retrieves option value based on option name from WordPress database.
*/
function noindex_seo_admin() {
?>
<div class="wrap">
<h1><?php echo esc_html( __( 'noindex SEO Settings', 'noindex-seo' ) ); ?></h1>
<form method="post" action="options.php">
<?php
settings_fields( 'noindexseo' );
?>
<p><?php echo esc_html( __( 'Important note: if you have any doubt about any of the following items it is best not to activate the option as you could lose results in the search engines.', 'noindex-seo' ) ); ?></p>
<?php
$noindex_seo_error = 0;
if ( (bool) get_option( 'noindex_seo_error' ) ) {
$noindex_seo_error = 1;
}
$noindex_seo_archive = 0;
if ( (bool) get_option( 'noindex_seo_archive' ) ) {
$noindex_seo_archive = 1;
}
$noindex_seo_attachment = 0;
if ( (bool) get_option( 'noindex_seo_attachment' ) ) {
$noindex_seo_attachment = 1;
}
$noindex_seo_author = 0;
if ( (bool) get_option( 'noindex_seo_author' ) ) {
$noindex_seo_author = 1;
}
$noindex_seo_category = 0;
if ( (bool) get_option( 'noindex_seo_category' ) ) {
$noindex_seo_category = 1;
}
$noindex_seo_comment_feed = 0;
if ( (bool) get_option( 'noindex_seo_comment_feed' ) ) {
$noindex_seo_comment_feed = 1;
}
$noindex_seo_customize_preview = 0;
if ( (bool) get_option( 'noindex_seo_customize_preview' ) ) {
$noindex_seo_customize_preview = 1;
}
$noindex_seo_date = 0;
if ( (bool) get_option( 'noindex_seo_date' ) ) {
$noindex_seo_date = 1;
}
$noindex_seo_day = 0;
if ( (bool) get_option( 'noindex_seo_day' ) ) {
$noindex_seo_day = 1;
}
$noindex_seo_feed = 0;
if ( (bool) get_option( 'noindex_seo_feed' ) ) {
$noindex_seo_feed = 1;
}
$noindex_seo_front_page = 0;
if ( (bool) get_option( 'noindex_seo_front_page' ) ) {
$noindex_seo_front_page = 1;
}
$noindex_seo_home = 0;
if ( (bool) get_option( 'noindex_seo_home' ) ) {
$noindex_seo_home = 1;
}
$noindex_seo_month = 0;
if ( (bool) get_option( 'noindex_seo_month' ) ) {
$noindex_seo_month = 1;
}
$noindex_seo_page = 0;
if ( (bool) get_option( 'noindex_seo_page' ) ) {
$noindex_seo_page = 1;
}
$noindex_seo_paged = 0;
if ( (bool) get_option( 'noindex_seo_paged' ) ) {
$noindex_seo_paged = 1;
}
$noindex_seo_post_type_archive = 0;
if ( (bool) get_option( 'noindex_seo_post_type_archive' ) ) {
$noindex_seo_post_type_archive = 1;
}
$noindex_seo_preview = 0;
if ( (bool) get_option( 'noindex_seo_preview' ) ) {
$noindex_seo_preview = 1;
}
$noindex_seo_privacy_policy = 0;
if ( (bool) get_option( 'noindex_seo_privacy_policy' ) ) {
$noindex_seo_privacy_policy = 1;
}
$noindex_seo_robots = 0;
if ( (bool) get_option( 'noindex_seo_robots' ) ) {
$noindex_seo_robots = 1;
}
$noindex_seo_search = 0;
if ( (bool) get_option( 'noindex_seo_search' ) ) {
$noindex_seo_search = 1;
}
$noindex_seo_single = 0;
if ( (bool) get_option( 'noindex_seo_single' ) ) {
$noindex_seo_single = 1;
}
$noindex_seo_singular = 0;
if ( (bool) get_option( 'noindex_seo_singular' ) ) {
$noindex_seo_singular = 1;
}
$noindex_seo_tag = 0;
if ( (bool) get_option( 'noindex_seo_tag' ) ) {
$noindex_seo_tag = 1;
}
$noindex_seo_time = 0;
if ( (bool) get_option( 'noindex_seo_time' ) ) {
$noindex_seo_time = 1;
}
$noindex_seo_year = 0;
if ( (bool) get_option( 'noindex_seo_year' ) ) {
$noindex_seo_year = 1;
}
?>
<h2><?php echo esc_html( __( 'Main pages', 'noindex-seo' ) ); ?></h2>
<table class="form-table">
<tr>
<th scope="row"><label for="noindex_seo_front_page"><?php echo esc_html( __( 'Front Page', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_front_page" name="noindex_seo_front_page" value="1"
<?php
if ( $noindex_seo_front_page ) {
echo 'checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-no" title="No"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing of the site\'s front page.', 'noindex-seo' ) ); ?> <a href="<?php echo esc_url( get_site_url() ); ?>" target="_blank"><?php echo esc_html( __( 'View', 'noindex-seo' ) ); ?></a></span></fieldset></td>
</tr>
<tr>
<th scope="row"><label for="noindex_seo_home"><?php echo esc_html( __( 'Home', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_home" name="noindex_seo_home" value="1"
<?php
if ( $noindex_seo_home ) {
echo 'checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-no" title="No"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing of the site\'s home page.', 'noindex-seo' ) ); ?> <a href="<?php echo esc_url( get_home_url() ); ?>" target="_blank"><?php echo esc_html( __( 'View', 'noindex-seo' ) ); ?></a></span></fieldset></td>
</tr>
</table>
<h2><?php echo esc_html( __( 'Pages and Posts', 'noindex-seo' ) ); ?></h2>
<table class="form-table">
<tr>
<th scope="row"><label for="noindex_seo_page"><?php echo esc_html( __( 'Page', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_page" name="noindex_seo_page" value="1"
<?php
if ( $noindex_seo_page ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-no" title="No"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing of the site\'s pages.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
<tr>
<th scope="row"><label for="noindex_seo_privacy_policy"><?php echo esc_html( __( 'Privacy Policy', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_privacy_policy" name="noindex_seo_privacy_policy" value="1"
<?php
if ( $noindex_seo_privacy_policy ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-yes" title="Yes"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing of the site\'s privacy policy page.', 'noindex-seo' ) ); ?> <a href="<?php echo esc_url( get_privacy_policy_url() ); ?>" target="_blank"><?php echo esc_html( __( 'View', 'noindex-seo' ) ); ?></a></span></fieldset></td>
</tr>
<tr>
<th scope="row"><label for="noindex_seo_single"><?php echo esc_html( __( 'Single', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_single" name="noindex_seo_single" value="1"
<?php
if ( $noindex_seo_single ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-no" title="No"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing of a post on the site.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
<tr>
<th scope="row"><label for="noindex_seo_singular"><?php echo esc_html( __( 'Singular', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_singular" name="noindex_seo_singular" value="1"
<?php
if ( $noindex_seo_singular ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-no" title="No"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing of a post or a page of the site.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
</table>
<h2><?php echo esc_html( __( 'Taxonomies', 'noindex-seo' ) ); ?></h2>
<table class="form-table">
<tr>
<th scope="row"><label for="noindex_seo_category"><?php echo esc_html( __( 'Category', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_category" name="noindex_seo_category" value="1"
<?php
if ( $noindex_seo_category ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-no" title="No"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing of the site categories. The lists where the posts appear.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
<tr>
<th scope="row"><label for="noindex_seo_tag"><?php echo esc_html( __( 'Tag', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_tag" name="noindex_seo_tag" value="1"
<?php
if ( $noindex_seo_tag ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-no" title="No"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing of the site\'s tags. The lists where the posts appear.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
</table>
<h2><?php echo esc_html( __( 'Dates', 'noindex-seo' ) ); ?></h2>
<table class="form-table">
<tr>
<th scope="row"><label for="noindex_seo_date"><?php echo esc_html( __( 'Date', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_date" name="noindex_seo_date" value="1"
<?php
if ( $noindex_seo_date ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-yes" title="Yes"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing when any date-based archive page (i.e. a monthly, yearly, daily or time-based archive) of the site. The lists where the posts appear.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
<tr>
<th scope="row"><label for="noindex_seo_day"><?php echo esc_html( __( 'Day', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_day" name="noindex_seo_day" value="1"
<?php
if ( $noindex_seo_day ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-yes" title="Yes"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing when a daily archive of the site. The lists where the posts appear.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
<tr>
<th scope="row"><label for="noindex_seo_month"><?php echo esc_html( __( 'Month', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_month" name="noindex_seo_month" value="1"
<?php
if ( $noindex_seo_month ) {
echo ' checked';
}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-yes" title="Yes"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing when a monthly archive of the site. The lists where the posts appear.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
<tr>
<th scope="row"><label for="noindex_seo_time"><?php echo esc_html( __( 'Time', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_time" name="noindex_seo_time" value="1"
<?php
if ( $noindex_seo_time ) {
echo ' checked';
}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-yes" title="Yes"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing when an hourly, "minutely", or "secondly" archive of the site. The lists where the posts appear.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
<tr>
<th scope="row"><label for="noindex_seo_year"><?php echo esc_html( __( 'Year', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_year" name="noindex_seo_year" value="1"
<?php
if ( $noindex_seo_year ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-yes" title="Yes"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing when a yearly archive of the site. The lists where the posts appear.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
</table>
<h2><?php echo esc_html( __( 'Archives', 'noindex-seo' ) ); ?></h2>
<table class="form-table">
<tr>
<th scope="row"><label for="noindex_seo_archive"><?php echo esc_html( __( 'Archive', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_archive" name="noindex_seo_archive" value="1"
<?php
if ( $noindex_seo_archive ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-no" title="No"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing of any type of Archive page. Category, Tag, Author and Date based pages are all types of Archives. The lists where the posts appear.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
<tr>
<th scope="row"><label for="noindex_seo_author"><?php echo esc_html( __( 'Author', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_author" name="noindex_seo_author" value="1"
<?php
if ( $noindex_seo_author ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-no" title="No"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing of the author\'s page, where the author\'s publications appear.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
<tr>
<th scope="row"><label for="noindex_seo_post_type_archive"><?php echo esc_html( __( 'Post Type Archive', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_post_type_archive" name="noindex_seo_post_type_archive" value="1"
<?php
if ( $noindex_seo_post_type_archive ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-no" title="No"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing of any post type page.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
</table>
<h2><?php echo esc_html( __( 'Pagination', 'noindex-seo' ) ); ?></h2>
<table class="form-table">
<tr>
<th scope="row"><label for="noindex_seo_paged"><?php echo esc_html( __( 'Pagination', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_paged" name="noindex_seo_paged" value="1"
<?php
if ( $noindex_seo_paged ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-yes" title="Yes"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing of the pagination, i.e. all pages other than the main page of an archive.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
</table>
<h2><?php echo esc_html( __( 'Search', 'noindex-seo' ) ); ?></h2>
<table class="form-table">
<tr>
<th scope="row"><label for="noindex_seo_search"><?php echo esc_html( __( 'Search', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_search" name="noindex_seo_search" value="1"
<?php
if ( $noindex_seo_search ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-yes" title="Yes"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing of the internal search result pages.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
</table>
<h2><?php echo esc_html( __( 'Attachments', 'noindex-seo' ) ); ?></h2>
<table class="form-table">
<tr>
<th scope="row"><label for="noindex_seo_attachment"><?php echo esc_html( __( 'Attachment', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_attachment" name="noindex_seo_attachment" value="1"
<?php
if ( $noindex_seo_attachment ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-yes" title="Yes"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing of an attachment document to a post or page. An attachment is an image or other file uploaded through the post editor\'s upload utility. Attachments can be displayed on their own "page" or template. This will not cause the indexing of the image or file to be blocked.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
</table>
<h2><?php echo esc_html( __( 'Previews', 'noindex-seo' ) ); ?></h2>
<table class="form-table">
<tr>
<th scope="row"><label for="noindex_seo_customize_preview"><?php echo esc_html( __( 'Customize Preview', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_customize_preview" name="noindex_seo_customize_preview" value="1"
<?php
if ( $noindex_seo_customize_preview ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-yes" title="Yes"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing when a content is being displayed in customize mode.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
<tr>
<th scope="row"><label for="noindex_seo_preview"><?php echo esc_html( __( 'Preview', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_preview" name="noindex_seo_preview" value="1"
<?php
if ( $noindex_seo_preview ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-yes" title="Yes"></span>. <span class="description"><?php echo esc_html( __( 'This will block the indexing when a single post is being displayed in draft mode.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
</table>
<h2><?php echo esc_html( __( 'Error Page', 'noindex-seo' ) ); ?></h2>
<table class="form-table">
<tr>
<th scope="row"><label for="noindex_seo_error"><?php echo esc_html( __( 'Error 404', 'noindex-seo' ) ); ?></label></th>
<td><fieldset><input type="checkbox" id="noindex_seo_error" name="noindex_seo_error" value="1"
<?php
if ( $noindex_seo_error ) {
echo ' checked';}
?>
> <?php echo esc_html( __( 'Recommended', 'noindex-seo' ) ); ?>: <span class="dashicons dashicons-yes" title="Yes"></span>. <span class="description"><?php echo esc_html( __( 'This will cause an error page to be blocked from being indexed. As it is an error page, it should not be indexed per se, but just in case.', 'noindex-seo' ) ); ?></span></fieldset></td>
</tr>
</table>
<?php submit_button(); ?>
</form>
</div>
<?php
unset( $noindex_seo_error, $noindex_seo_archive, $noindex_seo_attachment, $noindex_seo_author, $noindex_seo_category, $noindex_seo_comment_feed, $noindex_seo_customize_preview, $noindex_seo_date, $noindex_seo_day, $noindex_seo_feed, $noindex_seo_front_page, $noindex_seo_home, $noindex_seo_month, $noindex_seo_page, $noindex_seo_paged, $noindex_seo_post_type_archive, $noindex_seo_preview, $noindex_seo_privacy_policy, $noindex_seo_robots, $noindex_seo_search, $noindex_seo_single, $noindex_seo_singular, $noindex_seo_tag, $noindex_seo_time, $noindex_seo_year );
}