Jerry L
asked on
Wordpress Delete Page - Deleting a Page Leaves Remnants in Database
Wordpress 4.7.3
Custom Theme
Firefox Debugger: Firebug
BACKGROUND
We have a Contact page on ../contact/
We also have a Services page on ../services/
PROBLEM DESCRIPTION
The problem is that on the Services page, just under the header, above the page content, there is a horizontal area of red color where it should be black (See screenshot).
No other page is having this problem.
I have deleted the Services page in the Dashboard area, and then created a new page and named it Test. This Test page does not have the red horizontal area. But when I rename it to Services, again, the red horizontal area appears.
It seems that there are parts of the database that are not getting removed when I delete the page. Specifically in the tables: posts and postsmeta. You can see all the revisions still there, for example.
QUESTION
How can I completely remove all remnants, revisions, meta-stuff, etc. of the Services page?
MORE INFORMATION
When I use Firebug: (See Attached Screenshot and SCROLL down to the bottom to the BIG RED ARROW)
Other screenshots to show good and bad pages, and the Contact Page (in which horizontal red area is desired).
1) For some reason, on the Services page, the style element and properties for contact-form is rendered on the page. Other pages do not have this problem.:
I think this will not be an issue if I can solve the original question about deleting all remnants of the Services page. But I'm not sure.
FIREBUG SCREENSHOT
GOOD PRODUCTS PAGE
BAD SERVICES PAGE
GOOD CONTACT PAGE
Custom Theme
Firefox Debugger: Firebug
BACKGROUND
We have a Contact page on ../contact/
We also have a Services page on ../services/
PROBLEM DESCRIPTION
The problem is that on the Services page, just under the header, above the page content, there is a horizontal area of red color where it should be black (See screenshot).
No other page is having this problem.
I have deleted the Services page in the Dashboard area, and then created a new page and named it Test. This Test page does not have the red horizontal area. But when I rename it to Services, again, the red horizontal area appears.
It seems that there are parts of the database that are not getting removed when I delete the page. Specifically in the tables: posts and postsmeta. You can see all the revisions still there, for example.
QUESTION
How can I completely remove all remnants, revisions, meta-stuff, etc. of the Services page?
MORE INFORMATION
When I use Firebug: (See Attached Screenshot and SCROLL down to the bottom to the BIG RED ARROW)
Other screenshots to show good and bad pages, and the Contact Page (in which horizontal red area is desired).
1) For some reason, on the Services page, the style element and properties for contact-form is rendered on the page. Other pages do not have this problem.:
::afterThe Contact form page has a lot of red background in it, and I think that is what is causing the red horizontal area.
</div>
<div class="contact-form"></div>
I think this will not be an issue if I can solve the original question about deleting all remnants of the Services page. But I'm not sure.
FIREBUG SCREENSHOT
GOOD PRODUCTS PAGE
BAD SERVICES PAGE
GOOD CONTACT PAGE
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hello WizeOwl,
have you deleted the page from the trash as well?
Sometimes in older installs, the trashed page still has some impact until you empty it from the trash as well. When you look at your list of pages in the admin, you'll see the Trash link along with the others at the top left. You should empty the trash of any pages that are languishing in there.
have you deleted the page from the trash as well?
Sometimes in older installs, the trashed page still has some impact until you empty it from the trash as well. When you look at your list of pages in the admin, you'll see the Trash link along with the others at the top left. You should empty the trash of any pages that are languishing in there.
ASKER
Shown below is the "page source" (right click > show page source) for both versions of the rendered Services page in the browser.
QUESTION
Can someone help me figure out how to modify the Wordpress code to create a conditional statement in the LOOP that will eliminate these errors? Thanks!
ALSO, at some point, the file, "page-services.php", gets executed. Thus, there is probably a conditional "if" statement somewhere. I'll look for that.
The first difference is LINE 80:
This text shows in the /services/ permalink, but not in the /services-2/ permalink:
The next differences appear at LINES 100, 102, and 103
Note, in line 100, the class attribute for the Contact Form, <a class="attribute-value">co ntact-form </a>
QUESTION
Can someone help me figure out how to modify the Wordpress code to create a conditional statement in the LOOP that will eliminate these errors? Thanks!
ALSO, at some point, the file, "page-services.php", gets executed. Thus, there is probably a conditional "if" statement somewhere. I'll look for that.
The first difference is LINE 80:
This text shows in the /services/ permalink, but not in the /services-2/ permalink:
<span class="attribute-name">cla ss</span>= "<a class="attribute-value">se rvice1-pag e</a>"
The next differences appear at LINES 100, 102, and 103
Note, in line 100, the class attribute for the Contact Form, <a class="attribute-value">co
SERVICES1 PAGE (Permalink: /services1/) << RENDERING CORRECTLY
<span id="line80"></span></span> <span>< /<span class="end-tag">div</span> ></span ><span></s pan><span class="comment"><!-- id header--></span><span>< /span><spa n><<spa n class="start-tag">div</spa n> <span class="attribute-name">id< /span>="<a class="attribute-value">co ntent</a>" ></span ><span>
>>> snip <<<
<span id="line99"></span></span> <span>< /<span class="end-tag">div</span> ></span ><span>
<span id="line100"></span></span ><span>< ;/<span class="end-tag">div</span> ></span ><span>
<span id="line101"></span></span ><span>< ;/<span class="end-tag">div</span> ></span ><span></s pan><span class="comment"><!-- id content--></span><span>
>>> snip <<<
<span id="line99"></span></span>
<span id="line100"></span></span
<span id="line101"></span></span
SERVICES PAGE: (Permalink: /services/) << RENDERING INCORRECTLY
<span id="line80"></span></span> <span>< /<span class="end-tag">div</span> ></span ><span></s pan><span class="comment"><!-- id header--></span><span>< /span><spa n><<spa n class="start-tag">div</spa n> <span class="attribute-name">id< /span>="<a class="attribute-value">co ntent</a>" <span class="attribute-name">cla ss</span>= "<a class="attribute-value">se rvice1-pag e</a>"></span><span>
>>> snip <<<
<span id="line99"></span></span> <span>< /<span class="end-tag">div</span> ></span ><span>
<span id="line100"></span></span ><span>< ;<span class="start-tag">div</spa n><span class="attribute-name">cla ss</span>= "<a class="attribute-value">co ntact-form </a>">< /span><spa n>
<span id="line101"></span></span ><span>< ;/<span class="end-tag">div</span> ></span ><span>
<span id="line102"></span></span ><span>< ;<span class="start-tag">div</spa n> <span class="attribute-name">cla ss</span>= "<a class="attribute-value">cl ear</a>"&g t;</span>< span></spa n><span>&l t;/<span class="end-tag">div</span> ></span ><span>`
<span id="line103"></span></span ><span>< ;/<span class="end-tag">div</span> ></span ><span>
<span id="line104"></span></span ><span>< ;/<span class="end-tag">div</span> ></span ><span></s pan><span class="comment"><!-- id content--></span><span>
>>> snip <<<
<span id="line99"></span></span>
<span id="line100"></span></span
<span id="line101"></span></span
<span id="line102"></span></span
<span id="line103"></span></span
<span id="line104"></span></span
ASKER
FIXED IT
chilternPC got me headed in the right direction.
Added conditional test code for "Services" page in the page-services.php file.
chilternPC got me headed in the right direction.
Added conditional test code for "Services" page in the page-services.php file.
<?php if ( ! is_page('services') ) { ?>
<div class="contact-form">
<?php echo do_shortcode(rs::getField('ctf_shortcode',$post->ID, 'text')); ?>
</div>
<?php } ?>
ASKER
I modified the link to /services1/ and that fixes it. Searching the files on my hard drive (I unzipped a backup done by BackupBuddy), the word "services" appears in BackupBuddy files and in several sql tables. There is a page-services.php file mentioned in the options table of the database. It is for a so-called, "Template Name: Service page with contact form", so that looks suspicious - see code snippet below...
QUESTION
Is there a way to make it so I can use the permalink with /services/ in it? What do you suggest to get us a little closer?
NOTE
I sent you an EE internal message with the link in it.
Open in new window